Category: | Feature request |
Priority: | Normal |
Status: | New |
Project: | Severity: | Minor |
Resolution: | Open |
|
Component: | Reproducibility: | Not Attempted |
Assigned to: |
When running reports through the browser, only the locale the user logged in with is used to localize reports. There is no way to set the locale for the report interactively. This is not in tune with other areas of JasperServer, where you can set the locale of a report during scheduling, the HTTP API (view report) and web services.
I suggest that an input control called reportLocale can be added to a report so that the user can select the locale for the report. This could be a standard control available in the server. Extra marks would be given for a localizable, human readable display (drop down?) that is populated with the available locales for the report. In JasperServer Professional dashboards, you would need to be aware of the locales of the underlying reports.
2 Comments:
Made a change to the community edition and it looks like it is working:
jasperserver-ce\jasperserver\jasperserver-war-jar\src\main\java\com\jaspersoft\jasperserver\war\action\ViewReportAction.java
Sorry forgot to past the code:
protected void setReportLocaleParameter(RequestContext context, Map parameterValues) {
// Locale locale = (Locale) context.getFlowScope().get(getAttributeReportLocale(), Locale.class);
Locale locale = null;
String myLocale = null;
if(parameterValues.containsKey("reportLocale")){
myLocale = (String) parameterValues.get("reportLocale");
}
if (myLocale != null){
locale = LocaleHelper.getInstance().getLocale(myLocale);
}else{
locale = (Locale) context.getFlowScope().get(getAttributeReportLocale(), Locale.class);
}
if (locale != null) {
parameterValues.put(JRParameter.REPORT_LOCALE, locale);
}
}