Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Topic: Shared Variable rolling over to next record Posted: 07 Apr 2010 at 7:12am
I have a report with a subreport. In the subreport I created a shared variable I want to carry over to the main report: Shared NumberVar SubAvgPerformed; SubAvgPerformed :={@AvgPerformed}; I included this formula in the sub report and suppressed it. I my main report I have the following formula to bring in the shared variable: Shared NumberVar SubAvgPerformed;
I now have a formula using this value to show a variance on the main report: {#Drive_ProcedureProjection} - {@SubAvgPerformed}; This last formula is placed in a group footer below where the sub report is showing/calculating the values.
All is working fine except when I get to a record where there is no value in the sub report. When this happens I get the value from the previous record for my shared variable. So... my question is how to I clear/reset the shared variable after each record?
This formula needs to be placed in a section above the subreport in a section which would be run for each record i.e. not report header, page header - probably in Group Header 1 at a guess. Therefore everytime the subreport is run the variable should get reset. If a value is found in the subreport it will be displayed. If no value is found a 0 should be shown.
Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Posted: 07 Apr 2010 at 10:48am
Worked like a charm. I was trying to do something similar, but I was trying to put the reset formula in a footer below instead of the header above which was not working. Thanks for the help.
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