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

Total sum from subreports

Status
Not open for further replies.

Sanasta

Technical User
Aug 31, 2003
31
BG
I have a report with 5 subreports. Each subreport has in its footer sum of spesific expenses. In main report I
have summed these sums. In case any subrepost is missing, my final sum is error. I have tried with NZ, IsError, Is Null, IsEmpty functions, but result is the same.
Kindly please help me
Sanasta
 
The problem is likely that one of these values is null, so the grand total sum fails.

Place a formula like this in a section prior to running the subreports

whileprintingrecords;
shared numbervar sub1sum:=0;
shared numbervar sub2sum:=0;
shared numbervar sub3sum:=0;
shared numbervar sub4sum:=0;
shared numbervar sub5sum:=0;

And in the subreports you might use a null check to assure that it returns 0:

whileprintingrecords;
shared numbervar sub1sum;
If isnull(sum({table.value})) then
0
else
sum({table.value})

-k
 
This is a little off topic, but what you said you alread y have (the summation of subreports) is exactly what one of my co-workers just asked me about. If you could give me some info on how that is done, that would be fantastic!

Thanks!

JBLewis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top