2006 IR Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Ryan Johnson - delscovich Page break problem 2002-08-16 17:04 Hi all, I have a report with two columns, and if there are enough data rows to start the second column, the report becomes two pages long, with a blank second page. I've tried everything I can think of to make sure it's not some setting (summaryNewPage="false", etc), and nothing seems to make a difference. This happens in both 3.2 and 3.3, as near as I can tell. Any ideas? Thanks, Ryan By: Teodor Danciu - teodord RE: Page break problem 2002-08-19 05:05 Hi, I think I know what the problem is. It is indeed caused by the summary section, but not by the "isSummaryNewPage" flag as you mentioned. The summary will get printed on the same page as the last row ONLY IF on this last page of the report there is only one column started and no more. Why? Because if there is more than one column started, it means that the first one has run to the bottom of the page already, and there won't be any space left for the summary section on this page. You could say that your summary section has the height equal to zero and therefore we should not start a new page just to leave it blank. But the summary height equal to zero does not mean that you cannot place zero height text fields that would stretch with overflow and get printed anyway. So, this is how the library was always working and the only solution I see is to add the "printWhenExpression" functionality at band level. This is on my to do list, but never got the chance to give it a serious thought. I'll try. Thank you, Teodor By: Zsolt Berentey - zberentey RE: Page break problem 2003-03-21 11:45 Teodor, I would like to propose a patch: As you've suggested somewhere in the forum, an ugly solution would be to check the print file for empty page. This gave me the idea to patch the isToPrint method if JRFillBand. Here it is: protected boolean isToPrint() { if (this.isPrintWhenExpressionNull() || (!this.isPrintWhenExpressionNull() && this.isPrintWhenTrue())) { if ((getHeight() == 0) && (getElements().length == 0) && (getChildren().size()==0)) return false; else return true; } else return false; } This prevents the summary to be printed when there are no elements in it AND its height is 0. Do you see any problems with this? It solved my problem of an unwanted empty page at the end of the report... Greetings, Zsolt. 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