Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport variables 1

Status
Not open for further replies.

ruan123

Programmer
Jul 23, 2004
23
ZA
Hi, is there a way to pass the grand total sum of a subreport to the main report as a variable. I am using Crystal 10.
Thank you
 
You would create a shared variable within the subreport like:

whileprintingrecords;
shared numbervar grtot := sum({table.amt});

You must place this formula somewhere on the subreport canvas, so you could use it instead of the grand total on the subreport.

Then in the main report, you can reference it for further calculations, as in:

whileprintingrecords;
shared numbervar grtot;

grtot * {table.price}

Any formula in the main report which uses the shared variable must be in a section below the one in which the subreport is located.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top