Jasper Reports 中有新行吗?

发布于 2024-07-26 17:56:12 字数 104 浏览 7 评论 0原文

我刚刚开始使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

淡淡绿茶香 2024-08-02 17:56:13

isStyledText 设置为 true(勾选它)并使用
来换行。

例子:

text + "<br/>" + newLineText

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

Example:

text + "<br/>" + newLineText
肤浅与狂妄 2024-08-02 17:56:13

如果您使用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.

晨敛清荷 2024-08-02 17:56:13

如果您使用静态文本,在 Jasper Studio 中,您可以按 Shift + Enter

if you use Static Text, in Jasper Studio, you can press Shift + Enter

山川志 2024-08-02 17:56:13

将标记设置为 html,然后添加

Set the markup as html then add a <br/>

欢烬 2024-08-02 17:56:13

将文本字段表达式设置为:

$F{..}+"\n"+$F{..}

Set the text field expression as:

$F{..}+"\n"+$F{..}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文