• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1099
  • Last Modified:

Shared Variable will not reset

I have a very urgent request. I have a shared variable that I'm pulling from a subreport into the main report. The problem is the variable never resets at the group level. It grabs the total for the first product but then just repeats that same total for all of my products.. HELP!

Subreport formula is

WhilePrintingRecords;
Shared NumberVar MyPPORequirements;
if(isnull({#RSum_Quantity_Fixed})) or ({#RSum_Quantity_Fixed} = 0) then MyPPORequirements := 0 else
MyPPORequirements := -{#RSum_Quantity_Fixed}

Main formula is
WhilePrintingRecords;
shared numbervar MyPPORequirements;
MyPPORequirements
0
boukaka
Asked:
boukaka
1 Solution
 
zephyr_hex (Megan)DeveloperCommented:
i think you need to reset the variable by assigning 0 to it.  just create a new formula for this, and place it on the report at the point where the variable should reset.  make sure you have "whileprintingrecords" in that formula so it resets at the right time.
0
 
boukakaAuthor Commented:
That's working! Thank you for responding so quickly.
0
 
mlmccCommented:
Does the run ning total reset to 0?

I doubt it will ever be NULL

mlmcc
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now