Print Page | Close Window

Variable Not Resetting

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22614
Printed Date: 01 May 2024 at 6:02pm


Topic: Variable Not Resetting
Posted By: rcoxe
Subject: Variable Not Resetting
Date Posted: 31 May 2018 at 5:41am
I have a report where I am trying to calculate the average of the minimum daily value over a month. My report has 2 groups: #1- Personnel and #2- Day of the Month. Using CR 11.

I am using a shared variable to compute a running total for the month. This works fine for the first person but I cannot get the variable to reset for the next person. I have tried to place it in every possible section but it does not reset.

My first formula, in group 2 footer, calculates the running total for each day:
    WhilePrintingRecords;
    Shared Numbervar MinFirstCallSeconds := MinFirstCallSeconds + {@CallCompletedFirstSeconds};


In the footer of group 1 I have a formula to display the total:
    Shared Numbervar MinFirstCallSeconds; MinFirstCallSeconds;


And my reset formula:
    WhilePrintingRecords;
    Shared Numbervar MinFirstCallSeconds = 0;


No matter where I place the reset formula I get a result of "False" after the first person. What am I doing wrong?

Thank you



Replies:
Posted By: DBlank
Date Posted: 31 May 2018 at 7:02am
your evaluating for 0 (=), not setting it to 0 (:=)

WhilePrintingRecords;
Shared Numbervar MinFirstCallSeconds := 0;


Posted By: rcoxe
Date Posted: 31 May 2018 at 8:47am
Yes that was it. Thank you.



Print Page | Close Window