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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass a main report group total to a subreport ?

Status
Not open for further replies.

lsantos

Programmer
Jun 9, 2003
24
AU
Hi,

I am using Crystal Reports V7 and have a report + sub-report totalling question:

How can I pass a main report group total to a subreport so that I can provide: subreport group total = ((main report group total) – (subreport group total)) ?

Suggestions will be very much appreciated.

LS
Mullumbimby, Australia
 
Hi LS,

You need to store the subreport group total into a shared variable like:

shared numbervar grouptotal := Sum({LYsales},{Grouping});

Then in the main report declare the same variable:

shared numbervar grouptotal;

Then add the main report figure:

grouptotal := grouptotal + (main report grouptotal)

local variables disappear after it is used.

global variables exist throughout the report and can be accessed anywhere in the report.

shared varaibles are like global variables except subreports can access and modify values as well.

Hope this helps,

paulmarr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top