Problem splitting subreport

0

I have a report with 4 sub-reports in 4 different Details, with the last one spawing several pages, or none, depending of the amount of results and if they fit in the page or not. I want it to break into a new page in case it doesn't fit completely in the page it is, but I haven't had any good results yet. I've tried using different configurations of split, stretch, alignments, etc, that I've found searching through similar problems, but I can't reach a solution. Any suggestion would be completely appreciated (I'm using iReport 5.6.0, for more info).

Here's an example. "Top Sellers" is part of the sub-report, but it starts printing at the end of the page, where it finds space, instead of breaking into a new page. 

 

manuatilomb's picture
Joined: Mar 5 2015 - 8:57am
Last seen: 2 years 2 months ago

Solved: I was using a JRDataSource instead of a JRRewindableDataSource in my code. Once I changed it, and setted the Split Type property of the Detail bands to "Prevent" (as AnnMary Thomas suggested), it worked just fine

manuatilomb - 4 years 8 months ago

1 Answer:

1

Did you try setting Split Type property of  Detail band to "Prevent". This would keep the elements to gether for the first time when there is a split

AnnMary.Thomas's picture
Joined: Jun 18 2014 - 4:41am
Last seen: 3 years 1 month ago

I tried it, but I get an error when executing the code: net.sf.jasperreports.engine.JRException: The subreport is placed on a non-splitting band, but it does not have a rewindable data source.

I'm looking now at some solution more on the code side (I use Java to load the data on the report), but I still need some help figuring this out.

manuatilomb - 4 years 8 months ago

Solved: I was using a JRDataSource instead of a JRRewindableDataSource in my code. Once I changed it, and setted the Split Type property of the Detail bands to "Prevent", it worked just fine. Thanks!

manuatilomb - 4 years 8 months ago
Feedback