Carrm Posted August 17, 2020 Share Posted August 17, 2020 My goal is to split a huge text into 3 columns (in equal proportions) using Jasper Reports v6.13. I already achieved something close to my need when the remaining space of the detail band is reduced to 1/3 of the page; I'm able to display my text on 3 columns having the same amount of text. However, when the remaining space of the page is large enough (half the page or more), the detail band will expand and thus the text will be displayed in one giant column and maybe a few lines on the second column.Here is what I've done so far:create a subreport to handle the text and include it in some detail band of my main reportsplit the subreport into 3 columns with vertical displayput a textfield on the first column with Text Adjust to StretchHeightAgain, this works well when the main report's detail band can't expand much since the textfield will overflow on the other columns. My idea was to define some sort of maximum height for the detail band and/or the textfield so that the text will be forced to split without having to reach the bottom of the page.I tried setting the height of both the detail band and the subreport this way:JasperDesign design = JRXmlLoader.load(jrXmlInputStream);JRBand[] detailBands = design.getDetailSection().getBands();JRDesignBand mentionBand = (JRDesignBand) detailBands[detailBands.length - 1];mentionBand.setHeight(110);JRDesignSubreport mentionSubreport = (JRDesignSubreport)mentionBand.getElementByKey("mentions");mentionSubreport.setHeight(100);[/code]It doesn't work. My guess is that it actually defines some sort of minimum height for the band/subreport if the content isn't big enough to overflow rather than a fixed or maximum height. I also tried playing with the "Stretch Type" property with no success.How can I manage to define a maximum or fixed height for the detail band? 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