Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Running Total continues totaling in report footer Post Reply Post New Topic
Author Message
kemigirl
Newbie
Newbie


Joined: 05 May 2009
Online Status: Offline
Posts: 14
Quote kemigirl Replybullet Topic: Running Total continues totaling in report footer
     Posted: 02 Jun 2009 at 8:49am
I am currently using Crystal XI and I am a very new user to it.

My report is set up with running totals, calculating off groups rather than detail.  I am then carrying the running total to my report footer where I'm creating a "summary" of sorts for the user (I'll be hiding all the groups and details).

All my running totals show correctly in the report footer except for one.  It's the running total that counts the final record on my report.  It seems to want to add yet another "1", as if it were continuing to calculate my running total.  For example, it should show "112", and instead shows "113". 

Any thoughts on how to deal with this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jun 2009 at 9:14am
What do you mean by a RT that counts the final record?
What are the RT set up options or are you using variables that are counting/displaying?
IP IP Logged
kemigirl
Newbie
Newbie


Joined: 05 May 2009
Online Status: Offline
Posts: 14
Quote kemigirl Replybullet Posted: 19 Jun 2009 at 1:28pm
Sorry DBlank, I didn't realize anyone had responded to this thread. Embarrassed 

Originally posted by DBlank

What do you mean by a RT that counts the final record?  What are the RT set up options or are you using variables that are counting/displaying?

I have several manual RT's in my report, placed in group footers.  They look at the date in the group footer and count the group as "+1" if the date falls within a certain year (ex. 2004). I have separate RT's for each calendar year so that each group is accounted for in one of the RT's.   Only one of the RT's, then, actually counts the very last group.  That particular RT is the one that is causing the problem. 

My RT looks like this:

-----------------------------------------------------------------
WhilePrintingRecords;
Global NumberVar CY1HiresRT;

If PreviousIsNull({@Lawson ID})=True and totext({@Group - Year of Start Date},0,"")={@CY1_Name} Then
    CY1HiresRT:= 1
Else

If totext({@Group - Year of Start Date},0,"")={@CY1_Name} Then
    CY1HiresRT:= CY1HiresRT + 1
Else
    CY1HiresRT:= CY1HiresRT
;

------------------------------------------------------------------

When I display the RT in the group footer, it shows a total of 112.  When I place the RT in the report footer, it shows a total of 113. 

I hope this helps give a clearer understanding of what's going on.  Any help is appreciated!


Edited by kemigirl - 19 Jun 2009 at 2:01pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jun 2009 at 1:42pm
Gotcha-
There was no group change after your last record to reset it.
Variables are not my strength so hopefully lockwelle will read this and correct my error but ...I believe you have a formula to reset this to 0 at the GH. There is no GH after the last group so it is continueing to add...I think you would need another set of variables designed to count only the records where your GHyear is = to the last grouping (current year?).
Or you can create a RT using the RT GUI and conditionally count records with a reset of never and place it in your RFooter.
Make sense?
Lockwelle, was this on target?


Edited by DBlank - 19 Jun 2009 at 1:50pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Jun 2009 at 6:13am
DBlank asked me to look at this one.  I think that the formula is fine.  It reports in the group footer just fine.  When you move it to the report footer, it is still looking at the last record of the report, and so increments.  Instead of placing it in the report footer, I would suggest creating a new formula to just report the variable:
global numbervar CY1HiresRT
 
This way, it will just report the value and not increment it.
 
HTH
IP IP Logged
kemigirl
Newbie
Newbie


Joined: 05 May 2009
Online Status: Offline
Posts: 14
Quote kemigirl Replybullet Posted: 22 Jun 2009 at 9:49am
Thank you, DBlank and Lockwelle, for responding so quickly!

Lockwelle, your solution sounded the easiest so I tried that one first.  I created a formula in the report footer that referenced the variable.  It still, however, increased the number by 1 increment.  Perhaps I was doing something wrong with calling the variable?  I'm not sure.

Anywho, I tried using the RT GUI previously with this report and I couldn't get it to work.  I've made several changes to formats and formulas in my report since  then but never tried using the RT GUI again.  Since Dblank recommended looking at it, I tried it again today and after some coaxing and playing around with it, I actually got it to work.  I have a few ideas as to why it didn't work previously (which I won't get into here), but what matters is that it works now!  It stops at the last record and I get the correct number in my report footer.

Problem solved!
Thanks again to the both of you. This was an immense help!
IP IP Logged
ptoyn01
Newbie
Newbie


Joined: 24 Jan 2012
Location: United States
Online Status: Offline
Posts: 1
Quote ptoyn01 Replybullet Posted: 24 Jan 2012 at 6:11am
I am having a similar problem and it would be nice if someone did post the solution.  I've tried the suggestions to no avail.  I know this is an old post but I could use your help.

Thanks! 
IP IP Logged
Printable version Printable version

Forum Jump
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