guptaravi2k Posted May 13, 2009 Share Posted May 13, 2009 Hi,I want to fix the column width in output HTML report from jrxml file.In case value in a cell has more characters I want output text in the column to be wrapped in next line instead of same line because that stratches the width of column therby making all column of that (increased/distorted)width.I also notices following behavior:if value of text is : "ravi ravi ravi ravi ravi ravi ravi ravi ravi ravi ravi ravi"then output html report shows column value asravi ravi raviravi ravi raviravi ravi raviravi ravi raviwhich is fine......but if value is : "raviraviraviraviraviraviraviraviraviraviraviravi"then output html shows column value asraviraviraviraviraviraviraviraviraviraviraviravitherby increasing column width to accomodate whole length.how can i fix this problem in my jrxml file. I am attaching sample jrxml file. in this i want to fix the width of column "Fabric Name" in output HTML file.Please help me in this problem. Note: in PDF output file i am not facing such problem in this case text is automaticaly gets wrapped into next line. I am confused why only HTML output is getting screwed.thanksRavi GuptaPost Edited by guptaravi2k at 05/13/2009 11:44 Link to comment Share on other sites More sharing options...
guptaravi2k Posted May 14, 2009 Author Share Posted May 14, 2009 anyone there for help ?? Link to comment Share on other sites More sharing options...
jmartens Posted May 14, 2009 Share Posted May 14, 2009 I do not know the exact answer to your question, but I would suggest you look at the API for the JRHtmlExporter and the JRHtmlExporterParameter classes. If there is any capability for instructing the exporter to use the exact column widths found in the JRXML file, it would be there. Just google "JRHtmlExporterParameter API" to find them. Good luck. Link to comment Share on other sites More sharing options...
andfedotov Posted May 14, 2009 Share Posted May 14, 2009 Take a look at these parameters: /** * A boolean value specifying whether the export engine should use force wrapping by breaking words (CSS <code>word-wrap: break-word</code>). */ public static final JRHtmlExporterParameter IS_WRAP_BREAK_WORD = new JRHtmlExporterParameter("Is Wrap Break Word"); /** * Property whose value is used as default state of the {@link #IS_WRAP_BREAK_WORD IS_WRAP_BREAK_WORD} export flag. * <p/> * This property is by default not set (<code>false</code>). * * @see JRProperties */ public static final String PROPERTY_WRAP_BREAK_WORD = JRProperties.PROPERTY_PREFIX + "export.html.wrap.break.word";Post Edited by andfedotov at 14/05/2009 05:47 PM Link to comment Share on other sites More sharing options...
lucianc Posted May 20, 2009 Share Posted May 20, 2009 Also look at the net.sf.jasperreports.text.save.line.breaks property (introduced in JR 3.5.1). IS_WRAP_BREAK_WORD has the disadvantage that it doesn't work in all browsers (as it uses the CSS 3 word-wrap property).Regards,Lucian Link to comment Share on other sites More sharing options...
sandeepkanabar Posted August 5, 2012 Share Posted August 5, 2012 Hi Lucian,In our case, we are using jasperreports 1.2.7.jar and can't switch on to 3.5.1.jar!!. What can we do we to get word wraps? This issue has me scratching my head like anything.Would appreciate some pointers in this regard.Thanks in Advance.SandeepPost Edited by sandeepkanabar at 08/05/2012 19:40 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