Internationalization of jasper reports – Hello world example

Posted on by By Nikhilesh, in Business Intelligence, Data Visualization, Javascript | 0

Hi guys.. small work out but very use full..

Generally customers want to see data in their own language.

This example is developed using iReport 5.1.0 pro, Jasper server pro and foodmart db with postgresql.

Sources/References :

Example : Converting English to Spanish

1) From Jasper Community

 https://www.jaspersoft.com/jasperserver-and-ireport-internationalization#int_reports

2) From google translator

http://translate.google.co.in/#auto/pt/BRAZILIAN%20STATE%20X%20SIGN%20UPS

 

google_translator 3) Locale Codes 

 http://download1.parallels.com/Plesk/Plesk8.2/Doc/plesk-8.2-win-l10n-guide/39382.htm

4) http://www.tutorialspoint.com/jasper_reports/jasper_Internationalization.htm

Steps:

1) File->New ->Save report  to your fav directory.

2) Write a simple query and drag a field to title band( Not necessary to do but iReport requires some query and field otherwise it’ll show empty report).

3)Take Text field(Not static text) and write the following.

$R{localization.text1}

NOTE: $R is the special syntax used for internationalization of text in iReport.

4) Right click on report Name -> Select properties -> Give Resource bundle Name

Ex: localizationdemo

This is resource bundle name , do not give extension for this.

in_report

 

5) Publish your report to Jasper Server and in resources section add the bundle files.

You need to add two files..

One file contains general English text(USA) another consists internationalized text

In this example second file having spanish(B’z you are converting English to spanish)

 Right click on Resources -> Add -> Resource Bundle  id ,Name and browse for the files

You must add two files.

In this example:

File 1 ID & Name : localizationdemo.properties  (You can give any of your name , extension is not mandatory). Write this text in file

localization.text1=hello world

File2 ID & Name : localizationdemo_es.properties and add the file from your local machine. Write this text in file

localization.text1=hola mundo

 

In jasper server Change locale to es-Spanish

login_page_es_SpanishOUTPUT

output Meet us @

http://helicaltech.com/

 

 

 

 

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments