mitttico Posted April 6, 2011 Share Posted April 6, 2011 Hi!I did a report with ireport and after i use it in my java application. It's all right.Now I'd like use internationalization. How can I set to my report the language to use by my Java application? Thanks a lot. byeCode:JasperPrint jasperPrint = JasperFillManager.fillReport(reportFile, par, connection()); Link to comment Share on other sites More sharing options...
dgangstaz Posted April 6, 2011 Share Posted April 6, 2011 All your text should be passed as parameters from your application to the ireports design file.Example: if you're displaying text 'Demo text', create a parameter 'demo' to be displayed instead, and from your application pass parameters map with ('demo', 'Demo text') Link to comment Share on other sites More sharing options...
mitttico Posted April 6, 2011 Author Share Posted April 6, 2011 Thanks! But in my reports there are a lot of word to translate, I'd like to use the Internationalization! /tools/fckeditor/editor/images/smiley/msn/regular_smile.gifI have my file_en_EN.properties and other for other language and when a user of my aplllication want to print a report he views the report in his language.But how can I set the language from Java?I try to pass Locale in parameter:par.put("JRParameter.REPORT_LOCALE", locale);but it daoesn't work Link to comment Share on other sites More sharing options...
mdahlman Posted April 6, 2011 Share Posted April 6, 2011 Download JasperReports separately from iReport. It comes with lots of samples. This one should have exactly what you're looking for:demo/samples/i18nRegards,Matt Link to comment Share on other sites More sharing options...
mitttico Posted April 7, 2011 Author Share Posted April 7, 2011 OK! Great! Thanks a lot!!Code:It's par.put(JRParameter.REPORT_LOCALE, locale);and notpar.put("JRParameter.REPORT_LOCALE", locale); Link to comment Share on other sites More sharing options...
Recommended Posts
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