Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sum groups Post Reply Post New Topic
Author Message
Melina291
Newbie
Newbie


Joined: 05 Mar 2013
Online Status: Offline
Posts: 8
Quote Melina291 Replybullet Topic: Sum groups
    Posted: 14 Mar 2013 at 9:17pm
Goodmorning
I want little help again.
I have a field (1,2,3 values) that i have done it group by so i take something like that

1.Income
1 Thomas test 40
2 thomas test2 30
    sum:70

2.Spends
1.thomas test 23
2.thomas test 35
   sum:58


Total sum: income:70- spend:58

*Now i have done all the above but i cant do the last row. I dont know what field to put and how i can sum my groups above

IP IP Logged
Melina291
Newbie
Newbie


Joined: 05 Mar 2013
Online Status: Offline
Posts: 8
Quote Melina291 Replybullet Posted: 14 Mar 2013 at 10:32pm
I create a formula field and i have done something like that.

shared numbervar rtTotal;

if({Emp016.PelProm}="1") Then
rtTotal:=rtTotal+Sum ({Emp016.SynTeliko})

where the field pelprom is the field i group by and take values (1,2,3) and the field synteliko is the field with ammounds.

Now i want to get that at the end of report and not at the end of every group

GrandTotals
---------------------
Incomes: (sum of group with value 1)
Spends:  (Sum of group with value 2)
Store:(sum of group with value 3)
Total: Incomes-Spends-Store

So at the end i want 4  new fields but i dont know how to do it...Any help?


Edited by Melina291 - 14 Mar 2013 at 10:39pm
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 17 Mar 2013 at 10:29pm
Hi
 
Do the following :
 
--Insert a group on Emp016.PelProm
 
--Create the following formula and place it in group footer :
 
Whileprintingrecords;
Stringvar gTotal;
gTotal:=gTotal+({Emp016.PelProm}+','+Totext(Sum ({Emp016.SynTeliko},{Emp016.PelProm}))
 
Now at end of your report write this formula :
 
Whileprintingrecords;
Stringvar gTotal;
 
Replace(gTotal,',',Chr(13)

 
Thanks,
Sastry
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.