diff --git a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java index 5ee150b8..7928db85 100644 --- a/src/main/java/info/bukova/isspst/reporting/ParamFiller.java +++ b/src/main/java/info/bukova/isspst/reporting/ParamFiller.java @@ -12,8 +12,10 @@ import info.bukova.isspst.services.settings.GlobalSettingsService; import info.bukova.isspst.services.tripbill.TripBillApprovalService; import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.storage.FileStorage; +import net.sf.jasperreports.engine.JRParameter; import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; @@ -31,6 +33,8 @@ public class ParamFiller { private GlobalSettingsService settingService; @Autowired private TripBillApprovalService tripBillApprovalService; + @Autowired + private HttpServletRequest req; public void fill() { if (definition.getDataSet() == null || definition.getDataSet().isEmpty()) { @@ -95,6 +99,7 @@ public class ParamFiller { } definition.setParam("P_LOGO", storage.serverPath(settingService.getSettings().getLogoFile())); + definition.setParam(JRParameter.REPORT_LOCALE, req.getLocale()); Address mainAddress = settingService.getSettings().getMainAddress(); diff --git a/src/main/java/info/bukova/isspst/reporting/ReportController.java b/src/main/java/info/bukova/isspst/reporting/ReportController.java index 39c7e4e7..6706a2f9 100644 --- a/src/main/java/info/bukova/isspst/reporting/ReportController.java +++ b/src/main/java/info/bukova/isspst/reporting/ReportController.java @@ -73,6 +73,9 @@ public class ReportController { } catch (ReportException e) { logger.error("Report generation error: " + e.getMessage()); writeError(os, e); + } catch (Exception e) { + logger.error("Report generation error: " + e.getMessage()); + writeError(os, e); } finally { if (os != null) { try {