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

Value from shared number value returning to wrong row 1

Status
Not open for further replies.

jaltang

IS-IT--Management
May 15, 2002
6
US
I have a main report that has parts and services information. I have inserted a subreport which calculates a burdened labor rate for all entries on a particular invoice. I have inserted the subreport into the main report and it works great. I have also added a shared numbervar into the subreport to pass the total back to the main report so I can total all of the costs and figure a margin for each invoice. I have two problems. First the total the subreport is returning is for the previous record on the report.
col1 col2 col3 col4 col5
row 1 parts1 service1 inserted sub total1 null
row 2 parts2 service2 inserted sub total2 shared var1

Second, when the value is null for the inserted subreport, it returns the previous value. Any help would be appreciated.
 
Create a Invoice Group Header A and B (right click the Invoice Group and select insert section below)

Add a formula to the group header A to reset the value of the shared variable to 0.

Have the subreport fire in the Group Header B of the Invoice Grouping.

Use the shared variable in the Invoice Group Footer.

When it loops through the groups, it will set the shared variable to 0, fire the subreport, and if nothing is found it will reamin at 0 (not a previosu value), then in the group footer the shared variable will always be correct.

-k
 
Great, everything is calculating the way it should. However (and there is always a however), is there any way to have the shared variable move to the same line as the Group header B. The idea is to keep all of the information for a particular invoice on one line.
 
Thanks for your help. I ended up moving the couple of fields I was using from the subreport and using shared variables for them also. The subreport fires in the header (not displayed)and everything that needs to display, displays in the footer. It even runs quite a bit faster (I have no idea why, but faster is definitely better). Thanks, again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top