Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to Build Logic Into Report Post Reply Post New Topic
Author Message
bacid
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 4
Quote bacid Replybullet Topic: How to Build Logic Into Report
    Posted: 14 Oct 2011 at 11:36am
i have an existing crystal report which came with a piece of software we use.

currently the report will show a list of people with the different charge types associated to them along with the charge amount

ex. peter pan | charge1 | $10 | charge2 | $20 | charge3 | $30

originally this report listed each charge on it's own line.  i enabled the "format  with multiple columns" feature so that all the charges would be listed with the person on a single line.

i'd now like to go further and consolidate the different charges based on the type.

so that for example, charge1, 3, and 5 would be considered type A
charge 2, 4, and 4 would be considered type B

i'd then change the report so that i'd only have 2 columns, type A and type B

for every user underneath each column it'd displayed the sum total of all charges of each type.

using the example above it'd now only show the following:
ex. peter pan | $40 | $20

with that said, how can i achieve this type of logic?  are there any examples or similar reports that someone can point me to for guidance?

thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Oct 2011 at 3:51am
you can probably use running totals, but that is DBlank forte. 
 
I would use shared variables and formulas.  I would suppress the detail section and put the formula to consolidate the various columns in the detail section(it will still run) and then display the totals in the group footer.
 
actually you don't even need the shared variables, you can create a formula like sum({table.field1}, {group}) + sum({table.field3}, {group}) etc.
 
the group would be based on your list of people. If you want a larger total, just use the larger group.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Oct 2011 at 3:57am
if you know what your 'types' are and there is an easy way to define them 2 Running Totals will do the trick
group on the person
place the name in the group footer
create 2 running totals
name=type_A
field to summarize=table.charge
type=sum
evlauate=use a formula
table.type in ['type1','type2',etc.]
reset = on change of group (select name group here here)
place in group footer
 
other running total (type_B) is an exact replica but chaneg the evalaute formula to only include 'type  b' items.
IP IP Logged
bacid
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 4
Quote bacid Replybullet Posted: 24 Oct 2011 at 5:38am
thanks for the comments, i will try and report back on results
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.031 seconds.