From b5ffa6595f93aa25de7839ce9eef99d2158c7082 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Tue, 26 Aug 2014 18:16:41 +0200 Subject: [PATCH] =?UTF-8?q?Opraveno=20generov=C3=A1n=C3=AD=20sestavy=20se?= =?UTF-8?q?=20subreportem.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/reporting/PredefinedGenerator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/info/bukova/isspst/reporting/PredefinedGenerator.java b/src/main/java/info/bukova/isspst/reporting/PredefinedGenerator.java index ec620509..8bfac506 100644 --- a/src/main/java/info/bukova/isspst/reporting/PredefinedGenerator.java +++ b/src/main/java/info/bukova/isspst/reporting/PredefinedGenerator.java @@ -4,6 +4,9 @@ import java.io.File; import javax.servlet.ServletContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.JasperRunManager; @@ -16,6 +19,7 @@ public class PredefinedGenerator implements Generator { private ReportDefinition definition; private ServletContext ctx; + private final static Logger logger = LoggerFactory.getLogger(PredefinedGenerator.class); public PredefinedGenerator(ReportDefinition definition, ServletContext ctx) { this.definition = definition; @@ -30,8 +34,10 @@ public class PredefinedGenerator implements Generator { JasperReport report = (JasperReport) JRLoader.loadObject(getReportFile()); JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250"); loadLazyData(); + definition.setParam("SUBREPORT_DIR", ctx.getRealPath("WEB-INF/reports") + "/"); bytes = JasperRunManager.runReportToPdf(report, definition.getParams(), new JRBeanCollectionDataSource(definition.getDataSet()));; } catch (JRException e) { + logger.error("Generator error: " + e.getMessage()); throw new ReportException(e); }