Joined: 17 Jun 2011
Location: United States
Online Status: Offline
Posts: 15
Topic: Global date range applied to different date fields Posted: 25 Jun 2011 at 2:06am
I have created a report that has several sub-reports. I want to create a global date range parameter that applies to different date fields in the sub-reports
Global date range between: xx/xx/xxxx and xx/xx/xxxx
Admission sub-report field: "Admission Date" in global date range
Claims sub-report field: "Service Date" in global date range
Joined: 24 Jun 2011
Location: India
Online Status: Offline
Posts: 3
Posted: 25 Jun 2011 at 2:42am
1. Introduction This document describes the
steps that will allow nested sub reports to share some or all of the
selection parameters of the parent report.
This document shows reports that will share a date range as their parameters as this is a common link between reports.
The
instructions assume that both the Primary and Sub reports have been
completed and that the sub report has been inserted into the footer of
the Primary report. 2. Instructions 2.1. Set up the Primary Report In the primary report, create 2 parameter fields called startdate and enddate. You do not have to show these fields in the report.
These parameters are then shown in the report fields list as ?startdate and ?enddate.
Then
create 2 formulas called startdate and enddate. The startdate formula
should only contain the report field value {?startdate} and the enddate
formula should only contain the report field value {?enddate}.
These Formulas are then shown in the report fields list as @startdate and @enddate.
These formulas are required because you cannot create a subreport link based on a parameter field.
You
must then edit the selection criteria for the main report to include
the data range. Go to the menu options Report|Edit Selection
Formula|Record and enter/include the following record selection
criteria:
{table.datefield} >= {@startdate} and {table.datefield} <= {@enddate} 2.2. Set up the Sub Report Create the same 2 parameter fields and the same 2 formula fields in the subreport. These do not have to be on the actual report. 2.3. Link the Reports To link the reports go to the menu options Edit|Subreport Links. Select
the formula @startdate from the available fields. This will activate
field link section at the bottom of the screen. Remove the tick from
the checkbox to deactivate this area.
Repeat with the formula @enddate. Then select OK to close the window.
Now edit the sub report. The above procedure will have created two parameter fields in the sub report, {?Pm-@startdate} and {?Pm-@enddate}. These parameters represent the range value passed from the main report.
You will now have to edit the record selection formula for the sub report. Select Report|Edit Selection Formula|Record from the menu and change the record selection to read: {table.datefield} >= {?Pm-@startdate} and {table.datefield} <= {?Pm-@enddate}.
Now,
when the report is refreshed, the user will enter in the start and end
dates in the main report and these values will populate the record
selection formula in the subreport. (Ref... http://www.tek-tips.com/faqs.cfm?fid=1329)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum