New lines in Jasper Reports?

Kazade picture Kazade · Jul 9, 2009 · Viewed 32.7k times · Source

I've just started using Jasper Reports to generate reports from data retrieved using Hibernate. Everything is working, except JR doesn't seem to respect newline characters (\n) in text fields. Is there a way to force line breaks at newline characters?

Answer

Cristiano picture Cristiano · Aug 7, 2009

Set the isStyledText to true (tick it) and to break the line use <br/>.

Example:

text + "<br/>" + newLineText