Intital Value to running total
i am calculating a balance for debit and credit amount, however i want the balance to start from a certain value that i caluculate to a certain date from another query, how can i make the running total start from a given value
This discussion has been closed.
Comments
Hello!
To resolve this issue, store the opening balance in a report parameter (or a calculated field/script variable) and either add it to the text formula or update the variable in the BeforePrint band:
// Mthod 1: parameter + Total with ResetAfterPrint = false
[[InitBalance] + [RunningDeltaTotal]]
Or in the report’s C# script:
double balance; private void Report_StartReport(object sender, EventArgs e) { balance = Convert.ToDouble(Report.GetParameterValue(‘InitBalance’)); } private void Data1_BeforePrint(object sender, EventArgs e) { balance += Convert.ToDouble(Report.GetColumnValue(‘Ops.Amount’)); }In the second case, [balance] is displayed in the cell — the recalculation is performed sequentially for each row without resetting.