cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a total to sub report

Former Member
0 Kudos

I have a CR that has a subreports. Basically the data is all the same only getting one col from a different table.

I would like to have a grand total. 

What is the process? do I make a total in the main report and then can pass this to the sub report? and add to the grand total on that? how to pass this or is it a value in the cr.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Paul,

You use 'shared variables' to pass values from and to the Subreport.

You'd declare it like this:

shared numbervar x;

When passing values from the Subreport to the Main Report, you need to place the shared variable formula in a section 'below' the section that holds the subreport.

IN this case, if the grand total is supposed to be displayed on the Main Report, you'd first create this formula inside each Subreport (if you wish to add up values from all Subreports):

shared numbervar x := x + {sum_value};

Finally in the Main Report's footer, you'd place a formula with this code:


shared numbervar x;


-Abhilash

Former Member
0 Kudos

OK thanks, here we would want the grand total at the end which here is the sub report.

Former Member
0 Kudos

Then you could declare the shared numbervar in the main report above the subreports and use the variable in the last subreport to get the grand total.

-Ankush

Answers (0)