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

How to use a subreport value in a report?

Status
Not open for further replies.

pokerace

Technical User
May 24, 2005
118
US
C10

I have a report that links to a subreport and returns a value. I would like to use that returned value in a formula in the main report. Can I do this?
 
In the subreport, create a formula:

whileprintingrecords;
shared numbervar subamt := <your value>;

Place this in the subreport report footer (presumably this is a summary?).

Then in the main report, in a section below the one in which the subreport is located (if your subreport is in GHa, place the formula in GHb), you can add a formula that does a calculation, e.g.:

whileprintingrecords;
shared numbervar subamt;
subamt * {table.amt}/.5

-LB

 
Sure, you might consider sharing really basic information such as what section the subreport is in, and where you intend to use the value in the main report, and your software version.

In the subreport palce:

whileprintingrecords;
Shared numbervar SubValue := {table.field}

Then in any section subsequent to the subreport use:

whileprintingrecords;
Shared numbervar SubValue;
"Subreport returned " & SubValue

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top