I'm creating a report in pentaho report designer. I have a sub report in my main report where it gets some values. I want to display the sum of those values from the subreport in the main report.
Asked
Active
Viewed 5,208 times
1
-
Is your problem resolved? Don't forget to accept an answer :) – Cy Pangilinan May 11 '12 at 02:49
2 Answers
2
Or even better, if you JUST want to display it on the report and not use it in any further functions, simply drag the field you want total'd into the group footer or report footer section, click on the wizard-aggregation attribute and set that to Sum.
The function should be used if you want to refer to the total in other ways, i.e. in additional formulas etc. Because this "wizard aggregation" attribute is only a display attribute really.

Codek
- 5,114
- 3
- 24
- 38
-
Hmm haven't thought of that, well I considered the fact that he has a sub-report. – Cy Pangilinan May 08 '12 at 07:12
-
good point! so it depedns where the values are available of course, if only in the subreport then you'll have to use subreport export parameters to pass the sum'd value back to the main report. if the dataset is the same in the main report then it can be summed there of course. – Codek May 08 '12 at 08:01
-
1Codek - i do try to pass the value from my subreport to the main report.. and when i put the value in the group footer of the main report as a sum. i do not get a sum back. i just get the latest entry – Shahin Khani May 08 '12 at 22:28
-
You must use a function as cyril says. Create the function in the sub report, ( display the function itself on the subreport) and then pass that back to the main report. – Codek May 09 '12 at 07:54
1
Use the function Sum
by right-clicking Functions
, and then Add Functions
. Add to that the field (under field name) which sum of values you want to be displayed in the main report. After that, just drag the function you made onto your report.

Cy Pangilinan
- 562
- 1
- 7
- 22
-
hi, i tried to create like yours solution, but itsnot show on subreport's page footer – Oct 13 '16 at 06:38
-
Hmm, I'm not sure it's been like 4 years, maybe Codek's answer is much applicable, or there may be a newer version of Pentaho Reports/BI Suite. – Cy Pangilinan Oct 13 '16 at 16:46
-
i see... i am trying todo like @Shahin problem, i am using PRD 5, last night, i tried to do like your way, but i still not get a sum back. i just get the latest entry. – Oct 14 '16 at 02:38