Using return value of a subreport to make calculations

My subreport is winthin the detail band. I store the return value in a variable and print this variable in the same band. This works because I set the Evaluation Time of the element that uses the variable to Band.

This works fine for printing. But I need to acumulate the values returned by the subreport in a variable (let's call it SUM). I've tried every combinations of Reset type / Increment type / Evaluation Time to print SUM in the summary, but it's always zero, the initial value.

I guess the problem is that when SUM evaluates it's expression, the subreport hasn't run yet. For obivious reasons there is no "Band" Increment type for a variable.


gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 2 weeks 22 hours ago


Are you having the same issue as I describe here?

Because if you are and you find a solution please post it.

peter.w - 8 years 1 month ago

1 Answer:

Indeed, this is a timing issue when variable is evaluated before the sub report call. I would suggest either do the calculation in the display field where evelaution time can be controled, or pass and sum the tally inside sub report and return cumulative sum back to the main report.

tchen's picture
Joined: Feb 27 2008 - 7:33am
Last seen: 14 hours 52 min ago