Lets discuss following use case. Enable Japanese characters in PDF export of Ad Hoc view/report.
When you export from Ad Hoc designer/view (or Ad Hoc report) templates are used. By default, /Public/Templates/Actual Size is selected. For more info please refer to documentation and other wiki articles article:
- https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v640/configuring-ad-hoc#Templates_and_Generators
- https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v71/report-templates-0
- https://community.jaspersoft.com/wiki/change-ad-hoc-report-font-style-using-templates
Out of the box, report template styles use DejaVu font which doesn't support CJK (chinese, japanese, korean) glyphs. So, if you want to display Japanese chars in PDF export, you need to use custom font. For example, Arial Unicode MS.
There are separate styles for Chart, Table and Crosstab. For this demo, lets focus on Table output. Parent style for most table styles is ReportDefault. Lets update this style to use Arial Unicode MS font instead of default DejaVu Sans. We also need to reset inherited style like TableDetailTextStyle font to not overwrite parent font.
Please bear in mind that you need to generate Font Extension if you haven't already. Then export to JAR and upload resulting JAR to application classpath. If you are running JasperServer on Tomcat, you can add your arialUnicode_fontExtension.jar to apache-tomcatwebappsjasperserver-proWEB-INFlib folder.
Here is a screencast demonstrating full list of steps you need to take to update style to use Arial Unicode MS font in Table mode for default template
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now