Hallo, i'm new in develop and need Help for my case.
i want to create report and get value like yellow record.
row 1: balance due = invoice amount - payment amount
row 2,3,4... : balance due = balancedue from row 1(previous) - payment amount from record active
how to i convert to my code.
my code:
tmp.InvoiceAmount = custInvoiceJour.InvoiceAmount;
tmp.PaymentAmount = custSettlement.SettleAmountCur;
tmp.BalanceDue = tmp.InvoiceAmount - tmp.PaymentAmount;
i know its read record line not get value from previous.
Thanks Girish, its Helping me a lot
You could also handle it in the report with RunningValue(). Check out SSRS: Create a running total using RunningValue, for example.
Hi Dodi,
Try to save the last balance due amount in buffer variable during each loop and use that variable to calculate due amount. Also initialize integer variable so that for 1st record you can subtract invoice and payment amount and for upcoming records you can use that balanceDue buffer. Try below code and see whether its suit your scenario. Make sure your query run will loop from the highest amount.
//declare variable for balance due amount and globally. Amount balanceDue; integer i = 0; tmp.InvoiceAmount = custInvoiceJour.InvoiceAmount; tmp.PaymentAmount = custSettlement.SettleAmountCur; if(i == 0) { tmp.BalanceDue = tmp.InvoiceAmount - tmp.PaymentAmount; } else { tmp.BalanceDue = balanceDue - tmp.PaymentAmount } //assign value to balanceDue buffer. balanceDue = tmp.balanceDue; i = 1;
Thanks,
Girish S.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156