Jasper Reports 中有新行吗?
我刚刚开始使用 Jasper Reports 从使用 Hibernate 检索的数据生成报告。 一切正常,除了 JR 似乎不尊重文本字段中的换行符 (\n)。 有没有办法在换行符处强制换行?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
将
isStyledText
设置为true
(勾选它)并使用
来换行。例子:
Set the
isStyledText
totrue
(tick it) and to break the line use<br/>
.Example:
如果您使用iReport,则可以选择静态文本区域。 在右栏中,您将找到该对象的属性。 在“静态文本属性 -> 文本”下,您将找到您的文本。 单击按钮 [...],将打开一个窗口,您可以在其中输入文本(包括换行符)。
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.
如果您使用静态文本,在 Jasper Studio 中,您可以按 Shift + Enter
if you use Static Text, in Jasper Studio, you can press Shift + Enter
将标记设置为 html,然后添加
Set the markup as html then add a
<br/>
将文本字段表达式设置为:
Set the text field expression as: