2006 IR Open Discussion Posted September 2, 2006 Share Posted September 2, 2006 By: Jonathan - jonathan0000000 Subreport data spacing problems 2006-04-12 09:24I have a complex report that contains many subreports. Sometimes data from later subreports gets printed before earlier subreports. This only happens when the later subreport detail is shorter than the earlier subreport detail. Example report design: ------------------------------------------------ "PAGE "+$V{PAGE_NUMBER} ...some stuff that fills most of the page... Subreport A Subreport B ------------------------------------------------ If there is not enough space on the page to print an item from subreport A, I want the report to print like this: ------------------------------------------------ PAGE 1 ...some stuff that fills most of the page... PAGE 2 detail A1 detail A2 detail B1 detail B2 detail B3 ------------------------------------------------ But if the detail items in subreport B are smaller than those in subreport A, it sometimes prints like this: ------------------------------------------------ PAGE 1 ...some stuff that fills most of the page... detail B1 PAGE 2 detail A1 detail A2 detail B2 detail B3 ------------------------------------------------ The only way I have found to stop this behavior is to put a large space between subreports A and B, but then I always have this big empty space in the middle of the report. Is there any other way to solve this problem? Link to comment Share on other sites More sharing options...
sara Posted January 10, 2007 Share Posted January 10, 2007 ALL, IS THERE ANY SOLUTION FOR THIS PROBLEM. I AM ALSO STUCK WITH THE SAME. PLEASE REPLY REGARDS,SARA Link to comment Share on other sites More sharing options...
jmurray Posted January 10, 2007 Share Posted January 10, 2007 Have a look at http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=228&Itemid=109 as it may provide some clues. Although the example discusses Text Fields the principles remain the same because subreports will automatically grow to accommodate all data. So you don't need to worry about "Stretch With Overflow" as described in the example: it happens automatically. What is important is that: * the first subreport is Fixed Relative to Top* subsequent subreports are set to Float* all subreports are given a small vertical size (say 20 pixels) in the report design. JasperReports will automatically rezise them during the fill. If you try to guess the size that they need to be at design time you'll usually end up with layout problems in the report output. .Post edited by: jmurray, at: 2007/01/10 10:34 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