Tural
Tural

Reputation: 1128

Unicode issue when creating PDF report using JasperReports via Java code

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.

Upvotes: 1

Views: 3411

Answers (1)

Tural
Tural

Reputation: 1128

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.

Upvotes: 1

Related Questions