I have a shared variable in a subreport that sums an amount field and is linked to the main report by the group field 'Bank No'. If there are no fields in the subreport for the main report's group, the variable retains the value from the last group. How do I get this to reset?
To ease the confusion, here's the formula I am using to create the shared variable and an example report.
(As an aside, is there any way to get this to show 0 instead of null?)
Formula:
Shared numberVar OpeningBalance := Sum ({@Amount_moved});
In the main report, here is the (pseudo)formula to get the balance:
Shared NumberVar OpeningBalance;
Balance = OpeningBalance - Outputs;
And, here is a sample of data:
Bank Number - SubreportValue - Outputs - Balance
0715 - 30 - 450 - (-420)
0716 - Null - 400 - (-370)
To ease the confusion, here's the formula I am using to create the shared variable and an example report.
(As an aside, is there any way to get this to show 0 instead of null?)
Formula:
Shared numberVar OpeningBalance := Sum ({@Amount_moved});
In the main report, here is the (pseudo)formula to get the balance:
Shared NumberVar OpeningBalance;
Balance = OpeningBalance - Outputs;
And, here is a sample of data:
Bank Number - SubreportValue - Outputs - Balance
0715 - 30 - 450 - (-420)
0716 - Null - 400 - (-370)