Hi Lockwelle,
Instead of creating sub report, I defined Array in my report.
the below are arrays which I defined in my report to calculate 12 months formula.
1. first I initialized array with this formula:
whileprintingrecords;
Shared Numbervar Array CashTotalArray;
Redim Preserve CashTotalArray[1000];
Shared Numbervar CashTotalCounter:=1;
2. Then I created second formula to calculate sum
whileprintingrecords;
Shared Numbervar Array CashTotalArray;
Redim Preserve CashTotalArray[1000];
Shared Numbervar CashTotalCounter;
3. Then I created third formula for 12 months sum
EvaluateAfter(
{@fCashTotalArray-2 Update});
Shared Numbervar Array CashTotalArray;
Shared Numbervar Counter;
Shared Numbervar MonthCounter;
//for counter:= 1 to 12 do
if MonthCounter>=12
then Sum(CashTotalArray[(MonthCounter-11) to MonthCounter])
else 0
As I used MonthCounter here so I created two new formula to initialize and update Monthcounter.
1. To initiate Monthcounter: Shared Numbervar MonthCounter:=1;
2. To update Monthcounter:
Shared Numbervar MonthCounter;
MonthCounter:=MonthCounter+1;
so If I put third formula( for 12 months sum) in report, it gives me zero (0) values. could you please have a look into formulas and tell me where am I wrong?
Thanks,
Remi