Skip to Content
avatar image
Former Member

Calculate sum of subreport values

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. )

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 16, 2017 at 11:47 AM

    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


    Add comment
    10|10000 characters needed characters exceeded