I have this report that has a chart over a period of months (x-axis). The Y-axis needs a cumulative sum of a buidling structure. I cannot add a running total, since its a string field, it can only do a count, but I need a cumulative sum like this.
Month Structure # Cumulative Structure #
Jan 3 3
Feb 6 9
Mar 2 11
Apr 10 21
So this is what I want to see in a line chart format. First I did a count formula for the structure Field and then plugged it in a shared variable formula to calculate the cumulative sum as shown below:
@Cumulativesum
whileprintingrecords;
numbervar sum;
sum :=sum + {table.structure}
Now, this variable cannot be seen in the chart expert availabe field section, so i wrote another shared variable like this
@sharedsum
whileprintingrecords;
shared numbervar sum;
sum;
I placed this formula in the details section and suppressed it, in the group header and suppressed it and also in the report footer where the chart is placed and suppressed it.
This formula (@sharedsum) can be seen in the chart expert 'available field' section. I added this formula in the show data section, but it seems like its only showing 0 for all the months. When i put this formula in the details section, the totals add add correctly, but not in the chart. So i dont know whats causing this problem. i dont need to reset the formula, because i need to add up the totals for each record. so can somebody help here please!. I have tried adding a subreport and pass the variable there in the subreport but even in the subreport all I get is just the total value instead of the range of values over the months.