Good idea but it needs a minor change since he wants the value from the subreport in the main report
In the main report header
WhilePrintingRecords;
Shared NumberVar MyNum:=0;
Global NumberVar MyTotal := 0;
''
In the subreport
WhilePrintingRecords ;
Shared NumberVar MyNum;
MyNum := Value;
''
In the main report after the subreport
WhilePrintingRecords ;
Shared NumberVar MyNum;
Global NumberVar MyTotal;
MyTotal := MyTotal + MyNum;
''
In the main report footer
WhilePrintingRecords ;
Global NumberVar MyTotal;
MyTotal
mlmcc
Main Topics
Browse All Topics





by: jruhePosted on 2009-10-30 at 10:22:17ID: 25705071
Are you using a variable that you're passing to and from the subreport? Something like this in the main report:
This will store the running total amount that is in the main report:
WhilePrintingRecords ;
Shared NumberVar MyNum:={#MyRunningTotal}
And in the sub, this will print MyNum:
WhilePrintingRecords ;
Shared NumberVar MyNum;
MyNum
I'm thinking you may want to reset MyNum in the header of the main report section:
WhilePrintingRecords;
Shared NumberVar MyNum:=0
That's how I'd do it, but I'm sure there are a lot more ways to skin that cat!
Joy