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

Sub-Reports Total

Status
Not open for further replies.

KBChristy

IS-IT--Management
Sep 3, 2002
32
0
0
GB
I have created a report with a field on which shows purchase orders outstanding. There is a sub-report behind it which details the individual purchase orders. I am having trouble though getting the total from the sub-report to show on the main report (it shows the first purchase order only). Is it possible? Do I need to create a manual running total? If so, where do I do this - on the main or on the sub-report?

Thanks
 
Create a formula in the subreport, something like:

whileprintingrecords;
shared numberVar num_purchase_order_total;
num_purchase_order_total := the formula showing the purchase order totals in the subreport;

And in the main report create a formula along the lines of :

whileprintingrecords;
shared numberVar num_purchase_order_total;
num_purchase_order_total;
 
Thanks for that. I can get the correct value showing in the sub-report but it always shows as 0 in the main report. Does it matter that it is an on-demand report? Does it matter also that I have groups in the sub-report?
 
I am sure it has to do with the fact that it is an On Demand Subreport. The On Demand subreport doesn't execute until someone actually clicks on it.

One thing to remember is that when you use shared variables and you are trying to pass the value from a subreport, you need to use the variable in the main report in a section below the section that contains the subreport. Did that make sense at all?

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top