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

Using the values of formulas from a Sub-Report into the main Report

Status
Not open for further replies.

Jaycee93

Programmer
Dec 5, 2002
3
0
0
PE
Hi all,

I need some help in using values and formulas. This is the issue: I am using a report with two sub-reports, I need to put the value of some formulas used in the sub-report into the main report. Any help or tip will be greatly appreciated, please reply to me directly to "jthornto@visiontech.com.co"

Juan C. Thornton
IT Consultant
VisionTech del Perú S.A.C.
 
Sorry, I avoid direct email contact as a general rule. You can set up email agents from this site.

You would use Shared Variables to do this.

The help is fairly clear, but here's an example:

In the main report header add:

whileprintingrecords;
shared numbervar MyNumber :=0;

This sets it to zero

In the subreport, reference this variable, as in:

whileprintingrecords;
shared numbervar MyNumber := {table.field};


After the subreport fires, you can obtain the value, as in:

whileprintingrecords;
shared numbervar MyNumber;
{Maintable.Somevalue} - MyNumber

This would subtract the subreport value from the main report value.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top