当 textField 为 html 标记时打印自定义符号

Print custom symbol when textField is html markup

我正在尝试在带有 html 标记的 jasper 报告文本字段中打印字符串 "<",但它没有显示。这是我的示例代码:

CONCATENATE("<", $F{ComponentName}.trim(), "> - ")

如果你在 textField 上使用 markup="html" 并且你想输出 <> 你需要像替换其他任何东西一样替换它们 html document

< with &lt;
> with &gt;

示例

CONCATENATE("&lt;", $F{ComponentName}.trim(), "&gt; - ")