Topic: shared Variable has me stumped!! Posted: 14 Jul 2009 at 12:24pm
Been bang my head with this one all day. I have used shared variables a whole bunch and never run into this problem. I'm sure it's something simple but I sure can't figure it out:
I have a subreport totaling some inventory data. I have created a shared variable in the sub and main reports to display the data because I need to use the shared variable value in a formula in the main report.
The shared variable in the sub shows the expected value. The matching shared variable in the main report shows the value for the record prior to it. The first record shows zero when the sub has a value for it.
The shared variable and sub report are in GF2 which is the inventory item summary in my report.
If anyone has any suggestions on things for me to look at, I'd sure appreciate it. Bellow are the formulas for the shared variable.
Many thanks,
Stokes
sub def: whileprintingrecords; shared numberVar sharedMatlUsage; sharedMatlUsage := Sum ({MatlUsageTran.Quantity-Purchase})
main def: whileprintingrecords; shared numberVar sharedMatlUsage; sharedMatlUsage
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 14 Jul 2009 at 6:48pm
I don't use them that much but since you are using the shared variable in the main report to display the variable from the subreport shouldn't that be put onto section GF2B in order to display the data from GF2?
Thank you for getting me to look at that again (and a fresh start this morning!). I had tried every combination of placement of the subreport and shared variable using subsections with no result. BUT, I had formulas using the shared variable in GF2a and when I moved them along with the shared variable to GF2b, the shared variable displayed the correct value. Silly me!
It's still not clear to me why the shared variable was displaying the next record value but I'm glad the report is correct now. Thanks again!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum