15,905,508 members
1.00/5 (1 vote)
See more:
XML
```hi,

In my web Application i have showing report for "Customer Ledger"

Here i need to display report as follows...

BillNo|Credit | Debit  | Balance
--------------------------------------
B0982 | 1000  |    0   |   -1000
B0999 | 2000  |    0   |   -3000
B0982 |  0    |  2200  |   -800
B1200 | 5000  |    0   |   -5800

Likewise i need to Calculate my <b>"BALANCE".</b>

I have populate credit and debit from the DB, but now i need to Calculate Balance alone.

I have <b>"TotalAccountAmount"</b> which describe the total <b>amount of Billing</b> made for a particular customer. Now i need to calculate these above scenario based on my "TotalAccountAmount"

Posted
Updated 18-Aug-17 18:30pm
v2
Member 12347915 20-Jun-16 0:43am
if ({New_Balncesit.Amount} {New_Balncesit.Date}<> 'CR' ) - ({New_Balncesit.Amount}{New_Balncesit.Date} <> 'DR') then
""
else
ToText({New_Balncesit.Amount})

## Solution 1

hi Karthick,

Write the formula for capturing balance value.

Using Crystal report designer,
1. select Field Explorer window from Insert Menu --> Field Object
2. Click "Formula Fields" Tree node from field explorer window.
4. It will open another window to ask Formula name. enter formula name and click ok button.
5. It will open Formula Editor window with entered formula name
6. In that formula editor window click Report fields tree view and select Debit column and credit column other wise directly type like this `{Ledger.Debit} - {Ledger.Credit}`7. Click save and close button
8. Finally drag that formula to your report detail section.

Now it shows balance value in your crystal report

J.Karthick 10-Feb-12 5:59am
Yes, i have familiar with FormulaFields. But {Ledger.Debit} - {Ledger.Credit} not solve my problem. It just gives me Bill Balance amount, i need total ledger balance.

Anyway, Thanks for your solution boss :-)

## Solution 2

Using Formula in Crystal Report[^]

J.Karthick 10-Feb-12 6:03am
Excellent link what i need exactly....

Thanks a loooooot RAJA :-)
thatraja 10-Feb-12 6:12am
You welcome. BTW you know GIT? Come there.
J.Karthick 10-Feb-12 6:22am
WoooW.... Interesting !!!
i'll check this out...before that i need to finish my ledger report(My Boss torture ahead)... :-P :-)
Espen Harlinn 11-Feb-12 6:14am
5'ed!
Member 10690757 22-Mar-14 11:07am
but i want this on c# kindly help me ???