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

passing shared variables from sub report to main

Status
Not open for further replies.

chainedtodesk

Programmer
Feb 26, 2003
112
US
i am trying to make a report showing booked items from one sub report to the main report with all of the shipping info. i have created a sub report and my numbers match out. here is one of the formulas i am trying to work with, once i get one going correctly the others will flow.

whileprintingrecords;
shared currencyvar backlog1 := sum({RMOPNLODRK.NETSALE},{RMOPNLODRK.C6HITX})

and C6HITX is client info.

i then have the subform linked by client info

and have this field in my main report

whileprintingrecords;
shared currencyvar backlog1;
backlog1

but i am not getting the info at each client, i am only getting the last total from the sub report. i have a clear variable in the main but that doesnt change the outcome?

thanks
 
If you have a group on client info in the main report, then the subreport should be in GH_a and the reference to the shared variable in GH_b. Or at least the sub must be in a section above the one in which the reference formula is located. If the sub is linked on client info, it needs to be in a group section.

-LB
 
thanks for that info, i do have it in the GH for the client, which is what i thought may be my issue, i have moved the clear variable in all areas above the header and it either returns all zeros or just the final outcome from the sub report. i have the subreport linked by the client number only to the main report
 
What "clear" variable? If you have a reset formula like this:

whileprintingrecords;
shared currencyvar backlog1;
if not inrepeatedgroupheader then
backlog1 := 0;

...it should be placed in the report header and in the client group footer.

If the sub is linked on client and it is placed in the client group, then the result of your variable WILL be one value. What is it you are expecting?

-LB
 
that is what i was trying to produce, but the last entry in the subreport, client 8 is showing for all previous clients 1-7 and their numbers are not appearing at all??
 
Please explain exactly where everything is located in the main report--by report section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top