Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper Multi-language Reports


Arulmani

Recommended Posts

I face a couple of practical issues when designing the Jasper *.jrxml files to support Multi-language report generation.

 

1) Labels in different languages are of varied lengths / widths  - so I have different report sections for different languages - my report design has Language 1 Group Header / Footer, Language 2 Group Header / Footer & so on. This approach is manageable & OK for 2 or 3 languages, but will be clumsy if the number increases.. Any better and easy way to handle this ?

 

2) Also as mentioned in one of the earlier posts (http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=4127), I too face the problem of setting PDF Font Name & PDF Font Encoding properties dynamically.. Right now since I maintain separate report sections, I have hardcoded these in the report *.jrxml files. With the latest Jasper versions, is there any better way of handling this dynamically ?

 

3) I also have problems with PDF output in Indic languages - Hindi, Tamil, Telugu etc. OpenOffice API seems to provide good Indic font support. Since JasperReports internally relies on iText capabilities to generate PDFs, would like to know how easy is it to export PDFs to avail OpenOffice's Indic font support instead ? Is this sort of export achievable (using Jasper API) ? If yes how to proceed ?

 



Post Edited by Arulmani at 09/24/2009 11:41



Post Edited by Arulmani at 09/24/2009 11:47
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

1) Take a look at the supplied /demo/samples/i18n sample provided with the JR project. You'll see that the same text fields are using to display labels in different languages. As long as you make sure the text fields adapt to the text lenght using isStretchWithOverflow="true", it should be fine. Also, labels in different languages can be grouped inside resource bundle files attached to the report template and can be leveraged using the $R{key} syntax.

2) That thread you mentioned is a very very old thread. Nowadays you can make use of font extensions mechanism that have support for locales. Basically, you would use the same fontName attribute value, but the correct font will be picked up correctly from the font extensions, based on the REPORT_LOCALE fill parameter. Check the /demo/fonts folder to see what a font extension is made of. Note that font family can apply to certain locales and you could have several font families with the same name, but that apply to different locales, using different TTF files.

3) JR can leverage any TTF file. If OpenOffice comes with these TTF files, you can take them and configure them in a font extension JAR and deploy them with your reports.

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...