generally it should look like below
fetch data from sql, sum of Credit field & sum of Debit field group by LedgerId
and then sum(credit)-sum(debit) = balance if balance is (-) nagative then
in crystal report,
show that balance Debit side else in credit side,
and at last, in report footer display summary of Credit & Debit fields.
Note: As On Date : --- this report mostly need Date criteria ( filtration like... date should be Less than or equal to _______ date. so that in sql query also provide where condition for filtration of data using date.
Ledger Name Credit Debit
----------------------------------------
aaa 200
snfjkds 700
dslf 500
-----------------------------------------
Total 700 700
Happy Coding!
:)