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!

Calculating with a Shared Variable

Status
Not open for further replies.

tlbrown88

Technical User
Jun 28, 2010
20
US
Quick question, hopefully..... *Ü*
I have a shared var from my sub that I am using in a simple addition problem on my main. I can get the result of my addition to come up but it will only show the correct result on my GF2b, not my GF2a where I need it. When I pull the formula up to GF2a, it will only show the data from my main, it does not add my sub data.
Kind of perplexed here....any ideas??

 
The Sub Report that calculates the variable value needs to be in a section before where it is to be referenced in the main report. Split GFa into 2 sections and push the Sub Report into the new GFa and everything else from the original GFa into the new GFb.

Hope this helps.

Cheers
Pete

 
Hmmmm....Ok,I think I am doing what you stated above. So on my sub I am taking a vaule that is on GF1 and using in a calculation that is in GF2b on my main, this works perfectly, however if I pull the calc up to GF2a where it needs to be, it does not add the subreport value.

I've uploaded a visual that might help...although I'm not sure where you go to view it....engineering.com???
 
The sub is in GF1 (grouped by material)....the main is in GF2a (grouped by material)
 
?!? Not sure why it is not working as expected. Just for testing. Have you tried dropping a formula with just the shared variable into each of the sections after the sub-report and see what value you get?
 
Yes, tried it all. Funny thing is that I get the correct result of my calc on the main in GF2b but as soon as I move it to GF2a, it will not add the var number from the sub.
So, I found a work around that gives the intended results.
Basically, I moved all of my data less the original subreport to GF2b, made a copy of my sub, removed the variable so just the actual field data points remained, then imported the copy onto GF2b, this worked as my calulation remained as inteded (net inv from main + restricted from sub).
Becasue I could not supress the GF2a tab, I do get the dreaded "extra row" when I export but I can sort that out once I'm in excel.
Wish I could have figured out how to do it the correct way but I need to get this report published for the masses to use.
I would still like to work on it so any ideas you might still have would be appreciated.
Thanks all!!
 
Please explain report structure: details of groups, location (section) of sub report, location of formula that references the shared variable. Please also post the exact code you are using in the subsequent formula.

If you have the sub report in a section prior to the section where the formula references the variable (assuming no other errors), it will work.

Please note you can not suppress or hide the section where the sub report is. If you need to stop the sub report from displaying, suppress all sections within the sub report, format the sub report to Suppress Blank Sub Report, and then format the section of the main report where the sub report sits to Suppress Blank Section.

Cheers
Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top