Unicode issue when creating PDF report using JasperReports via Java code
Posted on April 2, 2013 at 11:59pm
I develop Spring based Web application which uses JasperReports Library 5.0.0 to create reports. First I had Unicode characters issue when I made design of report using iReport 4.5.1. I found this question here and solution was using font extensions. I did everything as described here ("Create a report and specify fonts"). I installed "Tahoma" font to iReport, checked "Emded this font to PDF document" and selected "Identity-H (Unicode with horizontal writing)" as PDF encoding. It solved my issue when I executed and saved report as PDF using iReport. But when I used "jasper" file compiled by iReport in my Java code, I again got the issue related with Unicode characters. Generated report doesn't contain some of language specific characters.
Please help me to solve this issue.
Posted on April 7, 2013 at 10:23pm
I found solution here.
- Just open the options dialog of iReports again.
- Select the iReport section (if not already selected).
- Click on the fonts tab.
- Select the previously installed font and click on the button "Export as extension".
- Chose a folder and filename ending with .jar
Now you have a ready to use font jar which can be used with JasperReports. Just add it to the classpath of your application.