File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jasper reports - Group several subreports

 
Leticia Barbalho
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a report with 3 subreports. I have a List for the main report, and one List for each of the 3 subreports. The list of my main reports is just a list of years, eg: 2010, 2011, 2012, 2013...

So far so good. The problem is that I'm not finding the right way to group them.

I need to group them in a way that each subreport shows the data relative to the year in question in the main report. It has to go like this:


--> 2010
- Report 1, with 2010 data
- Report 2, with 2010 data
- Report 3, with 2010 data


--> 2011
- Report 1, with 2011 data
- Report 2, with 2011 data
- Report 3, with 2011 data


The problem is, when I put a group in the main report, it does not group the subreports. I set a parameter in the subreport (the year), coming out of the main report. I checked, and the parameter gets to the subreport ok, but the group doesn't work. It only groups the main report, and the subreports get all messy. It is showing like this:


--> 2010
- Report 1, with data from all years
- Report 2, with data from all years
- Report 3, with data from all years

--> 2011
- Report 1, with no data
- Report 2, with no data
- Report 3, with no data


It also doesn't work when I group inside the subreport.... it makes it go like this:

--> 2010
- Report 1 with data from 2010
- Report 1 with data from 2011
- Report 2 with data from 2010
- Report 2 with data from 2011
- Report 3 with data from 2010
- Report 3 with data from 2011

--> 2011
- Report 1 with no data
- Report 1 with no data
- Report 2 with no data
- Report 2 with no data
- Report 3 with no data
- Report 3 with no data


I'm starting to think I'm gonna have to chance the whole structure to make it work. And I don't even know what I'm gonna change it to.


How can I do what I want?

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic