Friday, March 23, 2012

Passing data from subreport to main report

I need to convert a Crystal report that contains three subreports. Each of these subreports uses a different stored procedure to obtain data. The main report uses data from these subreports to calculate averages in the footer etc.

How do i get the data contained in these subreports so i can use it in my main report?

Thanks in advance

Pass the data through parameters from the subreport to the main report.

Or maybe you just need to restructure how these reports work. The main report shouldn't be dependent on the subreports. The subreports should be dependent (most likely) on the main report.

|||

You cannot reference a sub report from the main report to get totals, etc.

The only way parameters will work is if the user clicks on the subreport and opens the main report, but you are not doing that.

The way I have gotten around this is to calculate the totals/averages in a different dataset, load them into parameters (You cannot put fields into the footer) and put the value of the parameter in a textbox in the footer.

HtH

BobP

sql

No comments:

Post a Comment