Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Running balance in vendor statement Post Reply Post New Topic
Author Message
toanees
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: India
Online Status: Offline
Posts: 8
Quote toanees Replybullet Topic: Running balance in vendor statement
     Posted: 07 Aug 2008 at 1:02am
Okay, Iam dealing with a report in which i need to calculate the running balance of vendor statement. the report contants feilds like voucher number, document date , invoice number, reference, payment /, invoice and running balance.
 
Where iam facing problem is in "Running balance"
Running = opening balance+ invoice for invoice entry
Running balance=prevoius running balnace -payment entry
 
Iam getting incorrect output for running balance,
Iam new to crystal reports and i need help from you all.
 
can you give me the logic to calcualte correct values.
 
Thank you.Smile
Be passionate and very hardworking.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 Aug 2008 at 4:36pm

You have the right idea, but you need to be careful with how you initialize data and increase it's value. In the first example, you are adding the opening balance with the detail records' balance. The effect of this will be that the opening balance gets added over and over and over. Your final result will be huge (and very wrong). You need two formulas. The first initializes the varialbe to the opening balance and this would go in the group header (or report header). Then take the second part and make it its own formula as welll (Running = Running + Invoice amount) and put this in the details section. That way, the invoice amount is added to the previous balance for every detail record. And you also don't have the openning balance being added in multiple times.

So the key to remember is to separater the code that initializes a variable from the code that adds the valus from the detail records. That should get you on the right track.
 
My Encyclopedia book has many tutorials that teach you how to create and use running totals in your reports. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
toanees
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: India
Online Status: Offline
Posts: 8
Quote toanees Replybullet Posted: 12 Aug 2008 at 6:38am
Thank you very much . It solved my problem.
Be passionate and very hardworking.
IP IP Logged
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