How do I change the locale that JasperReports uses?

后端 未结 1 1838
囚心锁ツ
囚心锁ツ 2020-12-13 02:09

The windows installed on my machine has the locale en_AU and that\'s what JasperReports uses. I already tried changing the locale of all users, including the Ad

相关标签:
1条回答
  • 2020-12-13 02:40

    The locale is set during execution, not in the JRXML.

    Using Java, set the REPORT_LOCALE parameter for the report's parameter map. For example:

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

    Using Jaspersoft Studio, open the project properties dialog to the Report Execution area:

    Using iReport, set the report locale in the Options window under the "Report execution options" section in the General tab. This will set the report locale when run.

    0 讨论(0)
提交回复
热议问题