Search code examples
jasper-reportsexport-to-pdf

How to display Euro sign in pdf using jasper report?


I'm using XML to produce a jasper report with Java and Intellij IDE, jasper version is 5.0.4.

On the xml file there is Euro sign but when the report is created on pdf, I see € instead of

On the top of xml file I have the following encoding <?xml version="1.0" encoding="UTF-8"?>

And this is how I add Euro symble to the xml:

    <textFieldExpression>
      <![CDATA["Please send the amount of " + $V{total}.setScale(2, BigDecimal.ROUND_HALF_UP) + " € to the bankaccount ..."]]>
    </textFieldExpression>

How does it come and what should I add to the xml file to resolve this problem?


Solution

  • I have changed the jasperreports version from 5.0.4 to 6.17.0 and it solved the issue. In my opinion the reason why it doesn't display the symbol on correct why was that I changed java from 1.7 to 11 but I did not touche the jasperreports version.

    <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.17.0</version>
            <scope>compile</scope>
    <dependency>