From 1475babaa1e41eb8a911a04c8769c15529473546 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 29 Feb 2016 15:10:20 +0100 Subject: [PATCH] =?UTF-8?q?Vylep=C5=A1eno=20logov=C3=A1n=C3=AD=20chyb=20p?= =?UTF-8?q?=C5=99i=20generov=C3=A1n=C3=AD=20sestav.=20Sestav=C3=A1m=20se?= =?UTF-8?q?=20nastavuje=20locales=20pro=20form=C3=A1tov=C3=A1n=C3=AD=20?= =?UTF-8?q?=C4=8D=C3=ADsel=20z=20nastaven=C3=AD=20prohl=C3=AD=C5=BEe=C4=8D?= =?UTF-8?q?e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/info/bukova/isspst/reporting/ParamFiller.java | 5 +++++ .../java/info/bukova/isspst/reporting/ReportController.java | 3 +++ 2 files changed, 8 insertions(+) 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 {