0
votes

In Crystal Reports, what is the correct way of linking a parament subreport to the main report so the subreport does not run separately for each row of the main report?

enter image description here

The subquery (called paragon on the screenshot) is placed in a Group Header and it's linked to the main report with two parameters:

enter image description here

The main report returns about 300 records and watching it run, I can see that the subreport is run separately for every returned record which takes a fair bit of time.

If I run the SQL, which looks something like, directly say from PowerPivot,

with cte (select membership_info
          from   server1) 

select appointment_info, cte.membership_info
       from server 2

it only takes a few seconds to run. Unfortunately, because of REASONS (completely beyond my control) the query has to be run and formatted using Crystal Reports and it's scheduled to be run at regular intervals.

is there a better way of linking the report to the subreport, so the subreport executes only once?

1

1 Answers

0
votes

Subreport should fire once for each instance of a section you place it in (GH3 in your case). There is no way around that. But there are alternative approaches...

For example, why not simply join the membership and appointment tables in the main report? You can suppress the appointments detail if all you need is some summary info...