Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: total amount per page Post Reply Post New Topic
Author Message
cool_a
Newbie
Newbie
Avatar

Joined: 11 Oct 2009
Location: Indonesia
Online Status: Offline
Posts: 4
Quote cool_a Replybullet Topic: total amount per page
    Posted: 13 Oct 2009 at 2:05am
hi... niubeeee here....
 
i have 5records. n i spread it to 3 pages (each page only have 2 rows)
 
how do i get the total amount of each page?? i dont use group report
 
here is my data:
a   10
b   15
c    20
d   25
e   30
 
i want it to be shown as below:
 
PAGE 1
previous amt: 0
---------------------
a     10
b     15
--------------------
tot   25
 
PAGE 2
previous amt: 25
---------------------
c      20
d     25
---------------------
tot   70
 
PAGE 3
previous amt: 70
---------------------
e     30
---------------------
tot 100
 
how do i get the previous amt???
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 13 Oct 2009 at 6:20am
the way that I would get the previous amount is to use shared variable in a formula to record it.  you can use it to calculate the total as well.
IP IP Logged
cool_a
Newbie
Newbie
Avatar

Joined: 11 Oct 2009
Location: Indonesia
Online Status: Offline
Posts: 4
Quote cool_a Replybullet Posted: 14 Oct 2009 at 1:34am

hi.. thx 4 the reply....

i know it should use the formula... but how??? can u give some sample code? or maybe a step by step.

about the "total", i already able to make it... i only have problem with the previous amount..

thx in advance


Edited by cool_a - 14 Oct 2009 at 3:00am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Oct 2009 at 6:11am
shared numbervar prev;
shared numbervar total;
 
total := total + {table.field};
prev := prev + {table.field};
""//hides the output of the formula
 
to display:
shared numbervar prev
 
HTH
IP IP Logged
cool_a
Newbie
Newbie
Avatar

Joined: 11 Oct 2009
Location: Indonesia
Online Status: Offline
Posts: 4
Quote cool_a Replybullet Posted: 14 Oct 2009 at 9:36pm
thx...
 
but it gives a wrong calculation
 
it shows:
 
page 1:  should be: 0, your formulas give: 29.95
a  29.95
b  262.99
------
total: 292.94
 
page 2: should be: 292.94, your formulas give: 305.24
c  275.29
d  35.48
-----
total: 603.71
 
page 3: should be: 603.71, your formulas give: 353.57
e  48.33
f  132.9
--------
total: 784.94
 
i dont use the total formula u've given to me... coz i can manage with the total....
can u give another shot???
 
thx b4
IP IP Logged
cool_a
Newbie
Newbie
Avatar

Joined: 11 Oct 2009
Location: Indonesia
Online Status: Offline
Posts: 4
Quote cool_a Replybullet Posted: 14 Oct 2009 at 9:55pm
nvm.... already found
thx a lot 4 your help... coz without your syntax, i am unable to test other formula..
IP IP Logged
narendra_vajral
Newbie
Newbie
Avatar

Joined: 16 Oct 2011
Online Status: Offline
Posts: 4
Quote narendra_vajral Replybullet Posted: 16 Oct 2011 at 2:27am
hello,
im also looking for the same
can you post the formula what you using for this?

Thanks
Naren
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 16 Oct 2011 at 10:17pm
Me too,

I looking for the formula which can calculate my balance b/f + amount = cumulative figure.

But my all cumulative is add back the Balance B/f which is wrong.

Example, b/f = 60
A=20   cumulative =80
B=40   cumulative =120
c=60   cumulative =180

can somebody help on this formula how to do?

Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 17 Oct 2011 at 11:59am
you need to apply logic to determine when the previous is really 0.  Probably I would use:
if not OnFirstRecord then
 prev := prev + {table.field};
 
 
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.047 seconds.