简体   繁体   中英

Crystal Reports subreport performance

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?

在此处输入图像描述

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

在此处输入图像描述

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?

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM