Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html entity names not being displayed as the relevant html symbol in jasper report

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

like image 813
john Avatar asked Dec 16 '10 12:12

john


1 Answers

For a TextField object you need to set its markup property to html. As you say, &euro; is a HTML entity, not a RTF special symbol.

enter image description here

like image 170
Rubens Mariuzzo Avatar answered Nov 15 '22 08:11

Rubens Mariuzzo