Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Crystal Report - Writing Code In Loop Post Reply Post New Topic
Author Message
Victoryy
Newbie
Newbie
Avatar

Joined: 13 Dec 2010
Online Status: Offline
Posts: 6
Quote Victoryy Replybullet Topic: Crystal Report - Writing Code In Loop
    Posted: 13 Dec 2010 at 7:02pm
Hi,
I have a account ledger report. the report is grouped by account number..
For each account number i have derived the opening balance...
Again under the group of the account number there are detail entries of DR and CR amounts..
Now i have to derive the Closing balance along with opening balance with recursively adding DR and subtracting CR..
If Opening Balance is 100
DR    CR
10    20
20    10

Closing Balance Will Be
100+10-20 = 90
90+20-10 = 100

How can i do this in Crystal reports....
can i use the formula field, but how can i write a block of code in formula field. Cry

Thanks In Advance...
IP IP Logged
Isak
Newbie
Newbie


Joined: 25 Mar 2010
Online Status: Offline
Posts: 6
Quote Isak Replybullet Posted: 17 Dec 2010 at 12:37pm
Simple, if I'm understanding you right:

formula ={@OpeningBalance} + Sum({dr}, {accountNumber}) - Sum({cr}, {accountNumber})


The sum function will give you the sum of that field (first argument) for the group (second argument).
IP IP Logged
Victoryy
Newbie
Newbie
Avatar

Joined: 13 Dec 2010
Online Status: Offline
Posts: 6
Quote Victoryy Replybullet Posted: 21 Dec 2010 at 2:23am
Thanks A Lot!!!!!!!!!!
It Helped Me!!!!!!!!!!!!ClapSmileClap
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.