I've queries that retrieve snippets of text, which contain various html entity names, most notably €
and λ
, (not the actual symbol ie € or λ) from a database. I use the same queries to display reams of text in the browser, and in a RTF jasper report. the symbols are always displayed correctly in the browser.
However when i execute the query in jasper to generate a rtf doc, the €
string
comes out in the rtf doc as "&euro" ie the semi-colon has dissappeared, so instead of €1,000 I get &euro1000. Below is a textfield from my report. I've tried wrapping $P{label.htmlSnippet} in a CDATA but with no luck, the markup is html...so not sure what else I can do?
<textField isStretchWithOverflow="true" hyperlinkType="None">
<reportElement positionType="Float" x="375" y="285" width="80" height="12"/>
<textElement textAlignment="Right" markup="html"></textElement>
<textFieldExpression class="java.lang.String">$P{label.htmlSnippet}</textFieldExpression>
</textField>
any help, ideas suggestions appreciated
regards John
For a TextField
object you need to set its markup
property to html
. As you say, €
is a HTML entity, not a RTF special symbol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With