Hi all,
I have developed a report that will display a customer statements. In this statement first i want to display the opening balance. For that i have the following formula called runningBal.
numberVar runningBal:= {RPT_DP_CUSTOMER_STMT_SP.CLEARED_BAL}+{RPT_DP_CUSTOMER_STMT_SP.TOTAL_DR_AMT}-{RPT_DP_CUSTOMER_STMT_SP.TOTAL_CR_AMT};
And i want to show the each transaction and balance based on debit and credit of the customer account. For that i need to do the running total.
For example my opening balance = 1000, and my account has been credited by rs 100, then i want to show the balance as 1100 (1000+100) and if rs 100 is debited the i want to show 1000 (1100 - 100). This is need show in the detail section.
The following is the logic,
Logic:
1. Running Bal_0 = runningBal Calculated above
2. Running Bal_1 = Running _Bal_0+ [CR_AMT_1- DR_AMT_1]
3. Running Bal_2 = Running _Bal_1+ [CR_AMT_2- DR_AMT_2]
4. Running Bal_3 = Running _Bal_2+ [CR_AMT_3- DR_AMT_3]
5. Running Bal_4 = Running _Bal_3+ [CR_AMT_4- DR_AMT_4]
.
.
Please help me for doing running total. That is want to take the last balance for calculate the next running balance as per the above logic.
Edited by Shivacon - 17 Sep 2009 at 2:25am