Reputation: 938
My DB does not have the tables I need, so I have to create custom SQL queries (commands in Crystal terminology), embed the results in a subreport, and fill my report with subreports. Here's what I want to happen:
Report asks user for a date
That date gets passed into the subreports
The date passed into subreports gets used in the query.
User only has to enter date once, everything else happens behind the scenes
Here's what actually happens:
User is asked for date for subreport 1
User is asked for date for subreport 2
etc etc
User gets frustrated and report is unsuccessful.
I know I can link parameter fields between reports, but as I understand it, I cannot do the same with commands. How can I rectify this?
Upvotes: 1
Views: 2650
Reputation: 938
I was wrong about the links not working. They do work, with modification.
As long as your queries are using parameters named the same way, this can work. With the default linking, you'll get a parameter window that looks like this: https://i.sstatic.net/zuCxA.jpg. If you modify your linking to look like this: https://i.sstatic.net/8N4Wi.jpg, then the reportingDate parameter used in the main report will be passed into the individual SQL queries of the subreports, as expected. Thanks to Nepali for pushing me in the right direction!
Upvotes: 1
Reputation: 13733
Right-click on the subreport object and choose Change SubReport Links, then select how the parameter is to be used by the subreport.
Courtesy: @MartW
Upvotes: 2