How can I replace a - character in a text which comes from a data base into jasper field, with an image? The goal is as the illustration bellow:
Something like: $F{KN_Zusatzinfo_DV_Einleitungstext}.replaceAll("- ", "[\\x254]")
where the x254
is ascii code for a red square.
But the above code writes the ascii code as is in the text and does not produce the image.
The correct syntax to render a unicode symbol is
\uXXXX
For example this expression:
Will render this
Now you like the dot to be red so we need to apply some style, lets set
markup="html"
ontextElement
and change the replace to thisIt will render: