Solved

Shared Variable will not reset

Posted on 2008-10-13
3
1,094 Views
Last Modified: 2012-08-13
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
Comment
Question by:boukaka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 43

Accepted Solution

by:
zephyr_hex (Megan) earned 500 total points
ID: 22704595
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
 

Author Comment

by:boukaka
ID: 22704627
That's working! Thank you for responding so quickly.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22704639
Does the run ning total reset to 0?

I doubt it will ever be NULL

mlmcc
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question