Multiple sub-reports inside a master-report

Hello everyone,
I would desperately need some help to achieve the following:

  1. Create a master-report.jrxml, which includes a table of content and the corresponding sub-reports
  2. These sub-reports all contain a different chart with different data query, which can be bigger than one page
  3. Every page which includes a sub-report must show some static frame with dynamic content like the current sub-report's name and page X of Y

My approach so far was, to create a sub-report.jrxml for each of my required charts (I put chart in the sub-report's summary band). Then I created a MasterReport.jrxml with my static frame which included the sub-reports in the summary band. I expected/hoped that JasperReport would render a the according sub-report after each other, but it just overdraws on the same page.

How can I configure my report, to display the sub-reports after each other on new pages?

Any help with this, would be highly appreciated.

toffer's picture
Joined: Oct 21 2013 - 2:43am
Last seen: 6 years 2 months ago

1 Answer:

Hello CT

I need to do the same. I have basically the following process. I make a master report. This report contains some header stuff and some footer stuf. Then I place a subreport in the detail bar. In the master report this element is then set to Location.position type "float" .

Then in the subreport I place all other subreports.

To count the pages I've needed to place the standard page from .. to elements (in the palette) on every page. If it is not on every subreport either the pages following from this subreport are not counted :-( (Maybe there is a better way)

But the magic is to set all your elements to float to get them under each other. You are then the master of how big a page is by controlling the height of each detail part of each subreport, that's what worked for me.





mike2tango's picture
Joined: Sep 4 2013 - 5:56am
Last seen: 7 years 4 months ago

Thanks Mike, this did the trick. Additionally I had to change the detail band's layout to "Vertical Layout", then it finally rendered correctly.

toffer - 9 years 6 months ago