Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Calculating Running Total Post Reply Post New Topic
<< Prev Page  of 2
Author Message
komail
Newbie
Newbie


Joined: 20 Jul 2011
Location: Pakistan
Online Status: Offline
Posts: 1
Quote komail Replybullet Posted: 20 Jul 2011 at 11:45am
I have a similar situation... but my problem is that.. when I used this code.... the running total is fine.. but when this total is put in group footer... it add the last records value one more time in the final total...

Means, if the records are:

200
300
400

So, the total should be 900. But it calculates 1300 (adding 400) one more time.. when I put the field in group footer section.

My code is something exactly like:


numberVar Opening Balance;

IF OnFirstRecord THEN
Opening Balance := {RPT_DP_CUSTOMER_STMT_SP.CLEARED_BAL}+{RPT_DP_CUSTOMER_STMT_SP.TOTAL_DR_AMT}-{RPT_DP_CUSTOMER_STMT_SP.TOTAL_CR_AMT};

ELSE
Opening Balance:= Opening Balance+ [CR_AMT- DR_AMT]



Can you help?


Edited by komail - 20 Jul 2011 at 12:07pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Jul 2011 at 7:33am
create a separate formula that is:
numbervar Opening_Balance;
Opening_Balance
 
and use this formula for the group footer, otherwise it is just doing what you told it to do....add the record again.
IP IP Logged
<< Prev Page  of 2
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.049 seconds.