cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate sum of subreport values

Former Member
0 Kudos

I have a report that had to be built using subreports.

How can I calculate an overall sum from multiple sub reports and put this total in the main report?

(Our IT Director helped me get started with report and he looked at the information needed to pull and it had to be built this way. )

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Alexia,

Use a 'shared variable'.

For e.g. Open Subreport 1 and create a formula with this code:

shared numbervar gt := gt + {summary field};

Drag and drop this formula field on a section this needs to be calculated on.

Create the same formula in all subreports and place it on a section.

In the Main report, refer to this shared variable using this code:

shared numbervar gt;

Drag and drop it on a section 'below' the last of the subreports.

-Abhilash


Answers (0)