views:

1095

answers:

3

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?

+1  A: 

Try this: set the isStyledTex to true (tick it).

Than, when you whant to break the line:

text + "<br/>" + newLineText

Hope it helps you.

Thanks that works :). I had a similar problem were I had to display some preformatted text within a textElement and had problems with the unix and windows EOLs.
shyam
A: 

hasn't isStyledText attribute been deprecated for 3.0.0+? is there any option other than that?

Elijah
A: 

If you use iReport, you can select the static text area. In the right column you will find the properties of that object. Under "Static text properties -> Text" you will find your text. Click onto the button [...] so that a window opens where you can enter your text including line breaks.

vespa