在 jasper 报告(静态)文本字段中显示 html
Display html in jasper reports (static) text field
我在 jasper reports jrxml 的静态文本字段中有此文本
<div style='width: 200px;height: 200px; border: 5px solid red; background-color:red'></div>
如果我将字段设置为 'None',我可以在预览中看到原始 html,但是,如果我将其设置为 html,则什么都不会显示。显然它是一个 200px x 200px 的红色框,带有 5px 的黑色边框。我可以做些什么来让这个 html 显示在预览中吗?
标记仅负责文本表示。 JasperReports Ultimate Guide:
中仅列出了一组有限的受支持标记
<b>
<u>
<i>
<font>
<sup>
<sub>
<li>
<br>
如您所见,它们都与文本格式有关。
如果您需要红色方块,您可以通过添加具有所需背景颜色和边框的矩形来手动绘制它。来自同一指南的矩形元素的轻微修改示例:
<rectangle>
<reportElement x="0" y="350" width="200" height="200" backcolor="#ff0000"/>
<graphicElement>
<pen lineWidth="2"/>
</graphicElement>
</rectangle>
我在 jasper reports jrxml 的静态文本字段中有此文本
<div style='width: 200px;height: 200px; border: 5px solid red; background-color:red'></div>
如果我将字段设置为 'None',我可以在预览中看到原始 html,但是,如果我将其设置为 html,则什么都不会显示。显然它是一个 200px x 200px 的红色框,带有 5px 的黑色边框。我可以做些什么来让这个 html 显示在预览中吗?
标记仅负责文本表示。 JasperReports Ultimate Guide:
中仅列出了一组有限的受支持标记<b>
<u>
<i>
<font>
<sup>
<sub>
<li>
<br>
如您所见,它们都与文本格式有关。
如果您需要红色方块,您可以通过添加具有所需背景颜色和边框的矩形来手动绘制它。来自同一指南的矩形元素的轻微修改示例:
<rectangle>
<reportElement x="0" y="350" width="200" height="200" backcolor="#ff0000"/>
<graphicElement>
<pen lineWidth="2"/>
</graphicElement>
</rectangle>