dejanr Posted December 13, 2019 Share Posted December 13, 2019 Hi all,I have report with 9 subreports, each represents one table. It's page format is A4 landscape.In Details band are some details, and in Summary band are those 9 subreports, set to Position Type: Float and with equal height of 30px.Subreports contain Title (30px height), Column Header (40px height), Details (20px height) and Summary band (30px height).When I run report sometimes there is a page break after subreport's Title or before subreport's Summary band and it ends up on different page.I found posts explaining to avoid that behaviour you should set subreport component height to be higher, so it won't have page break after Title or before Summary band.So I should set subreport's height to be higher than it's Title (30px height) + Column Header (40px height) + Details band (20px height) = 90px to be able to print without unwanted page breaks.So the question is if there is some other way to achieve this?If not, how am I supposed to put 9 subreports each at least 90px high into A4 landscape report which has height 595px?Kind regards,Dejan Link to comment Share on other sites More sharing options...
dejanr Posted December 23, 2019 Author Share Posted December 23, 2019 I've managed to solve this by breaking each subreport into multiple details. This solution solves issue of page break after title or column band as well as before summary band.With this workaround you need to know total record count before rendering report ($F{totalRecordCount}).So, instead of just having title band, column band, detail band and summary band these are steps to solution:created additional 3 detail bands (now there are 4 in total)Column band now has printing condition : $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 01st detail band contains title elements + column elements + detail elements (fields to print)1st detail band has print condition:$F{totalRecordCount} > 1 && $V{REPORT_COUNT} == 12nd detail band contains just detail elements (original details band with fields to print)2nd detail band has print condition:$F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 1 && $V{REPORT_COUNT} < $F{totalRecordCount}3rd detail band contains detail elements (fields to print) + summary elements3rd detail band has print condition:$F{totalRecordCount} > 1 && $V{REPORT_COUNT} == $F{totalRecordCount}4th detail band contains title elements + column elements + detail elements (fields to print) + summary elements.It is printed just in case there is 1 record to print4th detail band has print condition:$F{totalRecordCount} == 1remove title and summary band, their elements are printed in detailsI am still having following issue - column band (step 1) sometimes prints, sometimes it does not.In some situations printing condition $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 0 works properly, and sometimes you need to change it to $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 1 to properly work. This looks like some sort of race condition. If anyone knows how to solve this, I would appreciate it.Kind regards,Dejan Link to comment Share on other sites More sharing options...
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