Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group summing Post Reply Post New Topic
Author Message
theop
Newbie
Newbie
Avatar

Joined: 30 Aug 2010
Location: United States
Online Status: Offline
Posts: 2
Quote theop Replybullet Topic: Group summing
    Posted: 30 Aug 2010 at 9:59am
I currently have in my formula in group details,
Shared CurrencyVar AmtA;
Shared CurrencyVar AmtB; 
If {table.LOANTYPE} in ("a";"b")
Then
AmtA := AmtA + {table.AMOUNT}
Else
AmtB := AmtB + {table.AMOUNT}; 
 
In the group footer for AmtA, 
Shared CurrencyVar AmtA; 
AmtA 
 
In the group footer for AmtB, 
Shared CurrencyVar AmtB; 
AmtA 
 
In the group header for AmtA, 
Shared CurrencyVar AmtA := 0;   
for AmtB, 
Shared CurrencyVar AmtB := 0; 
 
It keeps taking the last value in the group for AmtA and putting it in AmtB when all records should sum to AmtA. I can't seem to find a way to break these up accurately. Can anyone tell what piece I am missing ?
Thanks ! Wayne
 
Wayne
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 31 Aug 2010 at 3:47am

a couple of things. First, I put all my resets in 1 formula, not a big deal, just simpler to keep track of where things are.

second, the way that I would break them up, isn't so much breaking them up as adding additional formulas to 'see' what the report is doing. Sometimes I add addional sections after my data so that I can review the values in the shared variables and can 'check' that my logic is correct.  You could create a section below the details, for example, and drop the group footer formulas on it to see the values as they are changing... you could add one before as well and see how the values change and if they are being initialized as you think they are.
 
HTH
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.015 seconds.