manuatilomb Posted March 5, 2015 Posted March 5, 2015 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.
Solution AnnMary.Thomas Posted March 6, 2015 Solution Posted March 6, 2015 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
manuatilomb Posted March 6, 2015 Author Posted March 6, 2015 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 Posted March 6, 2015 Author Posted March 6, 2015 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 Posted March 6, 2015 Author Posted March 6, 2015 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now