I have a Jasper report created in Jaspersoft Studio which is used to generate an HTML report. It has a width of 550px. One of the data fields contains URLs, and some of these can be very long, for example:
http://www.example.com/example?q=wifjaiojwefijawefwkopkfeomikwmfimvwkemmcwoemcomwclewccoepcopwijefijajowkopfkwoekfokwofsdvwefjijwie&fwjiejfiwjiejfiwjef&fwewfwef
The problem I am having is that the generated report does not break the URLs mid word, i.e. in the middle of the characters in the query string, so the text field is stretched rather than being fixed at 550px. The wrapping takes place when the ampersand is reached, whereas I want it to just wrap at whatever part of the string reaches the set width.
I have tried the following properties on both the field and the report:
net.sf.jasperreports.text.truncate.at.char = true
net.sf.jasperreports.print.keep.full.text = false
I have tried the following property on the report:
The output was the same with all the combinations of these that I tried.
The same report is also used to generate a PDF report. The URLs in the PDF report wrap in the way I require, so it is just the HTML output that wraps differently.
I am using Jaspersoft Studio 5.6.2. The reports are run using JasperStarter 2.2.
Does anybody know how to get the HTML output to wrap in the required way?
From JasperReport configuration reference, it seams you have to set
net.sf.jasperreports.text.save.line.breaks = true
so the HTML exporter explicitly add line break to the report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With