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

Sub Report and passing variables

Status
Not open for further replies.

DougNaf

Programmer
Jun 2, 2005
32
US
I have a main program and a subreport and am able to pass a variable and results from the subreport to the main program and it works just fine. The variable is placed on a detail line (main program). The problem i am having is i would like to insert a group total for the variable, but am not able to select the option for a inserting a summary for the group. Does anyone have suggestions? I am using version 9.

Thanks
Doug
 
Use a variable in the main report to accumulate the shared variable. Let's say your shared variable from the subreport is x.

//{@reset} to be placed in the group header:
whileprintingrecords;
numbervar y := 0;

//{@accum} to be placed in a detail section below the one in which the subreport is executing:
whileprintingrecords;
shared numbervar x;
numbervar y := y + x;

//{@display} to be placed in the group footer:
whileprintingrecords;
numbervar y;

If the subreport can return nulls, you should also have a reset in the main report for the shared variable, in a detail section above the one in which the subreport is executing.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top