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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable reseting itself on next page

Status
Not open for further replies.

c8ltgkue

MIS
May 1, 2007
57
GB
Using CR XI

Hello all

I have a variable which calculates running total. The following formula is in GH#3

Shared NumberVar DODR;
DODR:= DODR + {@WrkDaysDtOrd_DtRecv}

CR resets the value of this formula if there are more than one page. This formula works fine on page 1 but on page 2 it resets itself. My formula to reset this variable is in GH#2
Has anyone experienced the same thing ?

Thanks
C8
 
I have manage to solve it myself. I had to use global variable instead of shared variable.

C8
 
Mot likely you are resetting the variable in the group header, AND repeating the group header on every page. In this case, use the following logic to not reset your variables:

WhilePrintingRecords;
If Not InRepeatedGroupHeader then
Myvar:=0

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Thanks

But it still doesn't work.

this is what I have in my reset formula

whileprintingrecords;
If Not InRepeatedGroupHeader then
Global NumberVar DOFH:=0;
Global NumberVar DRFH:=0;
Global NumberVar DODR:=0;

is it wrong ? or am I missing anything ?

C8
 
You need parens:

whileprintingrecords;
If Not InRepeatedGroupHeader then (
Global NumberVar DOFH:=0;
Global NumberVar DRFH:=0;
Global NumberVar DODR:=0
);

-LB
 
Where do you first define the variables? Normally you would put the INIT formula in the Report Header, but it would be easy to put it in the Page Header by mistake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top