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

Total for Subreport

Status
Not open for further replies.

AntonioPerera

Vendor
Jan 29, 2006
91
AU
HI ,

I have a subreport which gives a summarised total of a set of values.
Now I need to get the total of that sub report.

Example

A 100 Total (Subreport)
B 50 Total (Subreport)
C 20 Total (Subreport)
D 300 Total (Subreport)
Need to get total of these above

What is the best way to do this ?
 
If the sub is linked to the main report on the field you are showing as A, B, etc., then in the sub, you need to create a shared variable like this:

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

Place this in the report footer of the sub. Then in the main report, assuming the sub is in GH#1a, insert a GH#1 b and in that section, add a formula like this:

whileprintingrecords;
shared numbervar subtot;
numbervar grtot := grtot + subtot;

Then in the report footer, add a formula like this:

whileprintingrecords;
numbervar grtot;

-LB
 
My subreport falls into the details line and therefore I had to segregate it onto Details a and Details b.

My total should fall into a GF#2

I am not getting my desired results, instead there is a cumulative count.

Please suggest.
 
You would need a reset formula in GH#2 then:

whileprintingrecords;
numbervar grtot := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top