How to run a report in different languages based on parameter

How to run a report in different languages based on parameter given by the user and not based on which counrty the report will run?

simoskets's picture
Joined: May 17 2021 - 7:38am
Last seen: 4 months 23 hours ago

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

arai_4 - 4 months 3 weeks ago

1 Answer:

Hi,

you need tho put a locale parameter in execution time. For example in java, set the JRParameter.REPORT_LOCALE for the reports paramenters map like this:

java.util.Map parameters = getParameters();
java.util.Locale locale = new Locale( "en", "US" );
parameters.put( JRParameter.REPORT_LOCALE, locale);
JasperFillManager.fillReport( reportTemplate, parameters, dataSource );

I hope it works for you!

huargo's picture
64
Joined: Oct 24 2019 - 1:13am
Last seen: 4 months 1 week ago
Feedback
randomness