Setting REPORT_LOCALE in IReport?

偶尔善良 提交于 2019-12-17 20:32:29

问题


Is it possible to overwrite the Param REPORT_LOCALE via Scriptlet, or directly in IReports ?

Pseudocode:

 if($P{MYLOCALEPARAM}== 1) REPORT_LOCALE = "en_US";
    if($P{MYLOCALEPARAM}== 2) REPORT_LOCALE = "de_GE";
    ....

I start the reports via

"RunJasper.jar"
(gtwebmarque.com)

via PHP exec and i am loath to change and recompile this tool ...

I know that there are some localisation Options in IReport Options Tabs. But i would like to implement it dynamicly

BR Christian


回答1:


You can set locale with help of JasperReports API.

The sample:

Map params = new HashMap(); 
params.put(JRParameter.REPORT_LOCALE, Locale.US); 
JasperFillManager.fillReportToFile(compiledReportName, params); 


来源:https://stackoverflow.com/questions/8847698/setting-report-locale-in-ireport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!