Vylepšeno logování chyb při generování sestav.

Sestavám se nastavuje locales pro formátování čísel z nastavení prohlížeče.
master
Josef Rokos 9 years ago
parent b0fb32825b
commit 1475babaa1

@ -12,8 +12,10 @@ import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.tripbill.TripBillApprovalService; import info.bukova.isspst.services.tripbill.TripBillApprovalService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.storage.FileStorage; import info.bukova.isspst.storage.FileStorage;
import net.sf.jasperreports.engine.JRParameter;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -31,6 +33,8 @@ public class ParamFiller {
private GlobalSettingsService settingService; private GlobalSettingsService settingService;
@Autowired @Autowired
private TripBillApprovalService tripBillApprovalService; private TripBillApprovalService tripBillApprovalService;
@Autowired
private HttpServletRequest req;
public void fill() { public void fill() {
if (definition.getDataSet() == null || definition.getDataSet().isEmpty()) { 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("P_LOGO", storage.serverPath(settingService.getSettings().getLogoFile()));
definition.setParam(JRParameter.REPORT_LOCALE, req.getLocale());
Address mainAddress = settingService.getSettings().getMainAddress(); Address mainAddress = settingService.getSettings().getMainAddress();

@ -73,6 +73,9 @@ public class ReportController {
} catch (ReportException e) { } catch (ReportException e) {
logger.error("Report generation error: " + e.getMessage()); logger.error("Report generation error: " + e.getMessage());
writeError(os, e); writeError(os, e);
} catch (Exception e) {
logger.error("Report generation error: " + e.getMessage());
writeError(os, e);
} finally { } finally {
if (os != null) { if (os != null) {
try { try {

Loading…
Cancel
Save