HTML标记表到文本字段中-JasperReport [英] HTML Tag Table into Text Field - JasperReport
问题描述
我有一个使用html标记语言或样式输入到文本字段的参数.但是,当我放置tag时,它根本不显示.
I have a parameter input to Text Field with html markup language or styled. But when I put tag , It doesn't show at all.
Jaspersoft支持的thid标签:
Jaspersoft supported thid Tags:
<b/>, <u/>, <i/>, <font/>,<sup/>, <sub/>, <li/>, <br/>
有什么办法可以显示来自html标记的表格?如果不能,是否有其他解决方案?
Is there any way to show table from that html tag ? If it can not, is there any alternative solution ?
推荐答案
没有没有的方法来显示textField
中的html表.
There is no way to show html table's inside a textField
.
html属性只能用于字符的外观,不能 生成布局
The html attribute can only be used for how characters looks, not to generate layout
您唯一的选择是使用jasper报告 HtmlComponent <hc:html/>
The only option you have is to use the jasper report HtmlComponent <hc:html/>
示例
<componentElement>
<reportElement x="0" y="100" width="230" height="110" backcolor="#ADD8E6" uuid="332dd551-e8cd-4cb0-a11f-7325f481017b"/>
<hc:html xmlns:hc="http://jasperreports.sourceforge.net/htmlcomponent" xsi:schemaLocation="http://jasperreports.sourceforge.net/htmlcomponent http://jasperreports.sourceforge.net/xsd/htmlcomponent.xsd" scaleType="FillFrame" horizontalAlign="Left" verticalAlign="Top">
<hc:htmlContentExpression><![CDATA["<table><tr><td>Hello</td></tr><tr><td>World</td></tr></table>]]></hc:htmlContentExpression>
</hc:html>
</componentElement>
此组件的主要问题是,它会创建html的图像,并且缩放文本时会遇到问题.
The major problem with this component is that it creates an image of your html and you will have problem scaling text.
这篇关于HTML标记表到文本字段中-JasperReport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!