Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Running Total Results Post Reply Post New Topic
Author Message
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Topic: Running Total Results
     Posted: 28 Oct 2010 at 6:28am
I have two very similar reports but the RunningTotal field behaves differently for each.
 
Both reports use the same 4 groups and use the same RunningTotal (RT), Reset RT and RT Result formulas.  Both RT Result formulas are placed in Group Header 4. 
 
In one report, the record detail in GH4 is added to the RT Result field on the same row (what I want) while on the other report, the record detail is added to the RT Result field on the following row (not what I want).  I cannot figure out what would cause the RT Result field would be different in both instances.
 
Any ideas?
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Oct 2010 at 6:31am
RTs (actual crystal Running Totals, not formulas fields) do not function in Headers. They only show you the result of the first row of the data of where it is evaluating.
Move them to the group footer.
IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 28 Oct 2010 at 6:39am

Hi DBlank, I'm actually using formulas:

RunningTotal Result formula (placed in GH4):
WhilePrintingRecords;
CurrencyVar RunningTotal
 
RunningTotal formula (not placed on the report layout):
WhilePrintingRecords;
CurrencyVar RunningTotal := RunningTotal + {@new combined}
 
{@new combined} is a field displayed on GH4
 
Reset RunningTotal formula:
WhilePrintingRecords;
CurrencyVar RunningTotal := 0
 
Due to the nature of each report, I have placed the reset RT field in GH2 on the report that is working properly and in GF2 on the report that is not, I tried moving the RT field to GH2 on the report that isn't functioning correctly, but it didn't make a difference.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Oct 2010 at 7:03am
whileprintingrecords also require that the result be placed on or below the section where the the data is being evaluated
IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 28 Oct 2010 at 7:17am
I believe that's the case.  In both reports, RT Result is placed on GH4, where data is being evaluated.  Reset RT is placed in GF2.  RunningTotal is not on the report layouts.
 
So in GH4 of one report, I get:
 
GH4   (Sale #1)          RT
            100             100
 
GH4   (Sale #2)           RT
             100             200
 
 
In GH4 of the other report, I get:
GH4  (Sale #1)     RT
          100                0
 
GH4  (Sale #2)     RT
          100             100
 
GH4  (Sale #3)     RT
           100             200
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Oct 2010 at 8:51am
if you are placing them in a header then the last fgrouping before teh reset is being ignored.
Did you try moving them to the footer to see if your results became accurate?
IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 29 Oct 2010 at 4:26am

I'm confused then why it actually works exactly the way I want in one report, where Result is in GH4 and the Reset RT is in GF2.  It just doesn't work that way in the other, even though the fields have the same placement. 

IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 29 Oct 2010 at 4:29am
When I move RT Result to GF4, (keeping the Reset RT in GF2) it's still one row off.
IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 29 Oct 2010 at 5:01am
I decided to use the report I had that was working and redo the layout to match what I needed in the other report.  It worked.  Not sure what was wrong with that report, but issue solved.  Thanks for all your support! 
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