我知道如何在JasperReports中将内联样式应用于静态文本.可以对文本元素(文本字段)执行相同的操作吗?如果有,怎么样?
我想在文本字段中加粗一些文本。我访问了http://jasperreports.sourceforge.net/sample.reference/markup/index.html但没有得到想要的结果。我现在正在使用文本字段,但是当我尝试使用 styled/html 时,编译失败。那么你能帮我解决这个 jrxml 代码片段吗:
<textField>
<reportElement x="200" y="10" width="590" height="42"/>
<textElement markup="styled"/>
<textFieldExpression><![CDATA["The static text without any format.\nThe field's data with bold format<style isBold='true'>:" + $F{TASKS_SUBTASK} + "</style>\n<style isBold='true' isItalic='true' isUnderline='true'>The static underlined text with bold and italic format</style>"]]></textFieldExpression>
</textField>
Run Code Online (Sandbox Code Playgroud)
在此示例中:在 Jasper中设置文本字段的样式,文本字段表达式错误,编译失败。
您的帮助将不胜感激。