Reputation: 1327
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?
Upvotes: 16
Views: 52984
Reputation:
Set the isStyledText
to true
(tick it) and to break the line use <br/>
.
Example:
text + "<br/>" + newLineText
Upvotes: 17
Reputation: 171
if you use Static Text, in Jasper Studio, you can press Shift + Enter
Upvotes: 8
Reputation: 81
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.
Upvotes: 8