I have a report that has a subreport in the Detail section. I need to summarize a field from the subreport in the main report. Is this possible? If so, can you get me pointed in the correct direction?
You will need to use a shared variable to pass values back and forth between the subreport and the main report.
In the subreport:
WhilePrintingRecords;
Shared NumberVar ABC:=<<value or expression>>
In the main report
WhilePrintingRecords;
Shared NumberVar ABC
Or you can manipulate the subreport value after it get to the main report. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
The Shared Variable will need to be placed in either the same section as the subreport or any section below the subreport in order to return a value;-)
It doesn't carry the value over in the detail section (which is where the subreport is). It does work in the group footer though. How can I get the value to work in the main report/detail section? I assume I need to change the "WhilePrintingRecords" to something else?
OK, does that mean that there is not a way to display the value in the detail section? Is there a way to force the display of the variable in the main report to wait for the subreport to have completed running?
If you place the shared variable in any section of the main report after the section where the subreport is being processed, then the variable won't have any choice but to wait for the subreport to finish processing before it's displayed.
I have that working now. For some reason I can't run a summary on the formula eventhough I used a NumberVar. What can I do in the formula to make it a number so I can use it in a rollup.
Formula: WhilePrintingRecords;
Shared NumberVar JTT_for_Rollup
What's a rollup? A sum total? Sorry if that's a superfluous question, but I'm guessing it's an Americanism that hasn't hit the shores of England yet... like 'squirl'.
If you can't do an automated sum on your shared variable, you can total it up via another variable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.