Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)

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"

Please help me how to do it with CrystalReport FormulaField ???
Updated 18-Aug-17 18:30pm
Member 12347915 20-Jun-16 0:43am    
if ({New_Balncesit.Amount} {New_Balncesit.Date}<> 'CR' ) - ({New_Balncesit.Amount}{New_Balncesit.Date} <> 'DR') then

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.
3. Right click, popup menu will open and select "New" menu.
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
Share this answer
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 :-)
Here you go, this article is for you(Check the Stock balance formula there - screenshot)
Using Formula in Crystal Report[^]
Share this answer
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    
Member 10690757 22-Mar-14 11:07am    
but i want this on c# kindly help me ???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900