Symptom
- The static date range parameter is linked with subreport, the details are not filtered according to parameter.
- Inside the subreport, date range parameter appears as a date parameter.
- Date range parameter linked to subreport as shown in the below image.
Environment
- Crystal Report XI R2
- Crystal Report 2008
Reproducing the Issue
- Create a New Report using Employee table from the Xtreme Sample Database.
- Create a Static Date Range Parameter in the Main Report.
- Add a Subreport in the Detail Section and link it using this Static Date Range Parameter.
- A new parameter is being created inside the Subreport, and when we use the Same Parameter in Subreport in Select Expert it does not output a correct result.
Resolution
- Use the Static Date Range Parameter in Main Report, need to separate the Start Date and End Date in two different Formulae
- Create a Formula for e.g. date_start
- minimum({?Date parameter}); (Note : where {?Date parameter} is the Static Date Range Parameter.)
- Create Second Formula for e.g. end_date
- maximum({?Date parameter});
- Link the Subreport with this Two Formula and two new parameter will be created inside the Subreport.
- Inside the Subreport in the Report tab->Selection Formulas->Record write a Formula to filter the Record based on the Date Range
- {Employee.date} in {?Pm-@date_start} to {?Pm-@end_date}
- You can see the correct result inside Subreport.
Keywords
Date Range, Parameter, Subreport , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Product
Crystal Reports 2008 V1 ; SAP Crystal Reports XI ; SAP Crystal Reports XI R2
Attachments
link to subreport.jpg |
Detail shown on report.jpg |
date-range.jpg |