如何使用 JasperSoft Studio 创建超链接作为静态文本的一部分?
How to create a Hyperlink as part of a static text using JasperSoft Studio?
我有一个 StaticText,其中的文本类似于
If you want to be a member of our website, then make sure you let us
know by sending an email to foo@bar.com as soon as possible.
此文本位于文本标记的 <![CDATA[...]]
内。我想确保 foo@bar.com 是一个可点击的电子邮件地址。我已经研究了很长时间,我能想到的最好的办法是将它修改为 mailto:foo@bar.com 然后如果用 Chromium 打开它就变成可点击的 link (没有不幸的是,蓝色)和我打开它的所有其他程序根本没有将它识别为 link。我什至尝试在 foo@bar.com 上添加一个 HyperLink 并计划使其具有白色背景(我知道是 hacky),但是我尝试这样做却引发了错误。对于 Link 目标,我只能选择 Self、Top 或 Parent,但我想将其设为实际的电子邮件 link。我已经为 Hyperlink Reference Expression、Hyperlink When Expression 尝试了很多不同的值,并尝试通过创建一个名为 mailAddress
的变量来做到这一点,将其表达式设置为电子邮件我想要的地址,然后通过将引号中的电子邮件地址替换为 mailto:$V{mailAddress} 来引用它,但它已将其显示为文本。
所以,我的问题是:如何将部分静态文本转换为可点击的蓝色电子邮件地址?
我正在使用 TIBCO Jaspersoft® Studio 6.6.0 - JasperReports 6.6.0 的可视化设计器。
我是这样解决的:
在正文中 属性
This is a test <u><font color='blue'><a href='https://www.google.it'>Link</a></font></u> inside a static text
并将标记 属性 设置为 "html"
这是来源:
<staticText>
<reportElement x="0" y="130" width="230" height="41" uuid="01126997-9310-462e-bc3c-afd94a21ce63"/>
<textElement markup="html"/>
<text><![CDATA[This is a test <u><font color='blue'><a href='https://www.google.it'>Link</a></font></u> inside a static text]]>
</text>
</staticText>
使用 Jaspersoft Studio 6.10.0 测试
我有一个 StaticText,其中的文本类似于
If you want to be a member of our website, then make sure you let us know by sending an email to foo@bar.com as soon as possible.
此文本位于文本标记的 <![CDATA[...]]
内。我想确保 foo@bar.com 是一个可点击的电子邮件地址。我已经研究了很长时间,我能想到的最好的办法是将它修改为 mailto:foo@bar.com 然后如果用 Chromium 打开它就变成可点击的 link (没有不幸的是,蓝色)和我打开它的所有其他程序根本没有将它识别为 link。我什至尝试在 foo@bar.com 上添加一个 HyperLink 并计划使其具有白色背景(我知道是 hacky),但是我尝试这样做却引发了错误。对于 Link 目标,我只能选择 Self、Top 或 Parent,但我想将其设为实际的电子邮件 link。我已经为 Hyperlink Reference Expression、Hyperlink When Expression 尝试了很多不同的值,并尝试通过创建一个名为 mailAddress
的变量来做到这一点,将其表达式设置为电子邮件我想要的地址,然后通过将引号中的电子邮件地址替换为 mailto:$V{mailAddress} 来引用它,但它已将其显示为文本。
所以,我的问题是:如何将部分静态文本转换为可点击的蓝色电子邮件地址?
我正在使用 TIBCO Jaspersoft® Studio 6.6.0 - JasperReports 6.6.0 的可视化设计器。
我是这样解决的: 在正文中 属性
This is a test <u><font color='blue'><a href='https://www.google.it'>Link</a></font></u> inside a static text
并将标记 属性 设置为 "html"
这是来源:
<staticText>
<reportElement x="0" y="130" width="230" height="41" uuid="01126997-9310-462e-bc3c-afd94a21ce63"/>
<textElement markup="html"/>
<text><![CDATA[This is a test <u><font color='blue'><a href='https://www.google.it'>Link</a></font></u> inside a static text]]>
</text>
</staticText>
使用 Jaspersoft Studio 6.10.0 测试