cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Data to SubReports for Use in Selection Criteria

Former Member
0 Kudos

Crystal Reports XI Pro

I have a report that contains the main report and several subreports.  There is no relation between the main report and any of the subreports (no linking fields).  Each report is totally independent.  I want to be able to pass two date values from the main report to each subreport.  These date values will be used in the report selection criteria of each subreport.

I have tried Shared DateVar variables and they will not work in this context.  Any suggestions will be greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Greg,

Right-click the Subreport > Select Change Subreport Links > Move the first date field to the pane on the right > Uncheck the option 'Select data in subreport based on field' > Click OK

Repeat the above step for the next date value.

Inside the Subreport, you should notice that the two date fields you used in the 'Change Subreport Links option' appear as prompts.

You can now open the Record Selection Formula in the subreport and use these two prompts like any other field.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

You are a hero.  Your solution worked perfectly.  Thanks so much for your help.

Greg.

Answers (0)