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!

sum from shared variable 2

Status
Not open for further replies.

kuekue

Programmer
Dec 2, 2008
35
TH
i use sub report to calculate and send data with shared variable

but i need to sum in other group or report footer how to do it??

in running total it cannot sum this field.


Thanks.
 
You can use variables to do this. Create four formulas:

//{@Reset} for the higher order group header:
whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

//{@accum} to be placed in the section containing your shared variable (which I'll call x), which is below the section containing your subreport:
whileprintingrecords;
shared numbervar x;
numbervar sumx := sumx + x;
numbervar gtx := gtx + x;

//{@displaysumx} to be placed in the higher order group footer:
whileprintingrecords;
numbervar sumx;

//{@displaygtx} to be placed in the report footer:
whileprintingrecords;
numbervar gtx;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top