Jump to content
Changes to the Jaspersoft community edition download ×

Grouping and totalling lines with subreports

2004 IR Help

Recommended Posts

By: jaydee77ca - jaydee77ca

Grouping and totalling lines with subreports

2005-01-19 07:28



I'm hoping someone can help with a complex (well, complex for us since we are new to Jasper) report.


Here's some point form info:


- We have a master report with detail lines that is filled vertically.

- Each detail line has a subreport which contains column detail that fills horizontally.

- Each column in the subreport has fields which are arranged from top to bottom.

- Both the master report and each subreport use a JRBeanCollectionDataSource.


What we would like to do is group and sum the vertical lines. I have been able to accomplish the grouping such that the group headers and footers appear in the correct place, however obtaining the totals has proven more difficult. Basically, in the group footer I want to have another detail line that appears exactly like the other detail lines except that the data are group totals. Here's a plain text example that might help:


Detail Line A

AA1 | AA2 | AA3 | AA4 | AA5

AB1 | AB2 | AB3 | AB4 | AB5

AC1 | AC2 | AC3 | AC4 | AC5


Detail Line B

BA1 | BA2 | BA3 | BA4 | BA5

BB1 | BB2 | BB3 | BB4 | BB5

BC1 | BC2 | BC3 | BC4 | BC5


Subtotal Line

AA1+BA1 | AA2+BA2 | AA3+BA3 | AA4+BA4 | AA5+BA5

AB1+BB1 | AB2+BB2 | AB3+BB3 | AB4+BB4 | AB5+BB5

AC1+BC1 | AC2+BC2 | AC3+BC3 | AC4+BC4 | AC5+BC5


I am having trouble figuring out how to obtain the total AA1+BA1 at the master report level. Any guidance would be appreciated.





Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...