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

Adding subreport values 1

Status
Not open for further replies.

Saint1234

Programmer
Feb 18, 2004
25
0
0
IE
Hi
I am fairly new with crystal and i was wondering if anyone could help me with this problem. I have a main report called "Main Report" and two sub reports called "SubsubConRPT" and "subCon999". I have two running total fields within the subreports #RTotal0 in SubsubConRPT and #RTotal1 in subCon999. I need to add these two totals and display the final total in the "Main Report" formula field called @finaltotal.
I honestly dont have a clue where to start so any help would be greatly appreciated.

Many Thanks in advance
Gareth
 
You need to use shared variables to accomplish this.

Create this formula in the SubsubConRPT subreport:
Code:
whileprintingrecords;
shared numbervar subConRPT_Total := #RTotal0;
Place it in the subreport's report footer and suppress.

Create this formula in the subCon999 subreport:
Code:
whileprintingrecords;
shared numbervar subCon999_Total := #RTotal1;
Place it in the subreport's report footer and suppress.

In the Main report, create a formula to add the two shared variables together:
Code:
whileprintingrecords;
shared numbervar subConRPT_Total;
shared numbervar subCon999_Total;

subConRPT_Total + subCon999_Total;
Place it in the Report Footer if you want it at the end of the report. It has to be in a section that is after both subreports, otherwise it won't display in the main report properly.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top