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

Totaling fields from a main report with a sub report 1

Status
Not open for further replies.

jchewsmith

Technical User
Nov 20, 2006
161
US
I have a main report that has a distinct count of number of loans, then I have a sub-report that has a distinct count of number of loans from a different set of loans. How can I create a grand total to count all loans from both main and sub-report?
 
In the subreport, create a shared variable so you can convey the subreport total to the main report. Create a formula like this:

Whileprintingrecords;
Shared numbervar Subtot;
Subtot := distinctcount({table.loanID});

Then in the main report, in the report footer, use a formula like this:

Whileprintingrecords;
Shared numbervar Subtot;
Subtot + distinctcount({table.loanID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top