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!

Unsure of location of subreport

Status
Not open for further replies.

xsw1971

Programmer
Jun 21, 2001
153
US
My main report displays invoices. For each invoice I have created a subreport to get the details of the invoice and the invoice number is the parameter. Once I bring the details into my main report, I want to use the detail total for cost manipulations in the main report. I have created a shared variable in both the main and subreport, and it appears to be pulling in the values just fine.

My problem is where the values are displayed. My main report is grouped on the invoice number field, and the subreport is located in the invoice group footer. When I try to display the shared variable, also in the footer, it seems to be placing the value into the next group.

For example if group A's value is $500 and group B's value is $700, the report displays $0 for group A, $500 for group B, $700 for group C, etc. Maybe I'm just confused about where I'm supposed to put the subreport, but the values don't show up if I put it anywhere else.

Please help!!

Thanks,
Jennie
 
Perhaps you're resetting the value of the shared variable to the next group prior to displaying it?

-k
 
Not intentionally! :- ) How would I be doing that? I have a formula that says:

WhilePrintingRecords;
shared currencyVar sv_lab_cost;

I put this variable in the footer next to the subreport to make sure it's using the right value. How else would I display it?

Thanks for the fast reply,
Jennie
 
I think I got it figured out. I read in another thread that the subreport is the last thing to be read in a section, so I put my subreport in the Details section, left the shared variable in the Footer and it seems to be working OK now.

Jennie
 
Actually you can still put the subreport and shared variable in the footer if that suits you better.

You are right...the subreport is read last...SO... split the footer into 2 sections...put the subreport in the first section and the results of the shared variable in the second section.

That should work and you maintain the original look of your report. Jim Broadbent
 
Thanks for the tip, Jim! I'll give that a try b/c I'd rather have the info in my footer.

Jennie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top