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

passing values from the sub report to the main report 1

Status
Not open for further replies.

rubinap

Programmer
Aug 26, 2005
6
CA
I am calling the sub report from the main report - for each group( ie each supervisor ) - I am passing the user & the report date.

- what I want to do is calculate the total for all the users in the sub report & return that total back to the main report at the end of all the users
to print that total value in the main report.

( What I have right now is two sub reports - one giving me the totals user wise - & the second giving me the totals supervisor wise)

Is that possible?

rkp

 
Hi rubinap;

Yes - this is possible - create a shared variable to store the accumulation.

A shared variable is a variable that can be accessed and changed by both the main report and subreport.

Make sure you name the variable the same in both reports (inc case sensitivity) - declare the shared variable in the subreport first, like:

shared numbervar accumulate;

then assign a value to it as you go:

accumulate := accumulate + {db.newvaluefield};

Then in the main report just recall the shared variable:
shared numbervar accumulate;

I hope this helps!
Cheers
paulmarr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top