From 28488cf19146894aaf01b46049dab68a87d06803 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 20 Aug 2014 09:53:33 +0200 Subject: [PATCH] =?UTF-8?q?Dotahov=C3=A1n=C3=AD=20lazy=20dat=20v=20gener?= =?UTF-8?q?=C3=A1toru=20dynamick=C3=BDch=20sestav.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukova/isspst/reporting/DynamicGenerator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/info/bukova/isspst/reporting/DynamicGenerator.java b/src/main/java/info/bukova/isspst/reporting/DynamicGenerator.java index b2117879..d33e9e07 100644 --- a/src/main/java/info/bukova/isspst/reporting/DynamicGenerator.java +++ b/src/main/java/info/bukova/isspst/reporting/DynamicGenerator.java @@ -65,6 +65,7 @@ public class DynamicGenerator implements Generator { dr = rb.build(); JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250"); + loadLazyData(); JRDataSource ds = new JRBeanCollectionDataSource(definition.getDataSet()); try { JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), definition.getParams()); @@ -94,5 +95,15 @@ public class DynamicGenerator implements Generator { return null; } + + private void loadLazyData() { + if (definition.getService() == null) { + return; + } + + for (Object o : definition.getDataSet()) { + definition.getService().loadLazyData(o); + } + } }