Dotahování lazy dat v generátoru dynamických sestav.

multitenant
Josef Rokos 10 years ago
parent 23d2eb58f6
commit 28488cf191

@ -65,6 +65,7 @@ public class DynamicGenerator implements Generator {
dr = rb.build(); dr = rb.build();
JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250"); JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250");
loadLazyData();
JRDataSource ds = new JRBeanCollectionDataSource(definition.getDataSet()); JRDataSource ds = new JRBeanCollectionDataSource(definition.getDataSet());
try { try {
JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), definition.getParams()); JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), definition.getParams());
@ -94,5 +95,15 @@ public class DynamicGenerator implements Generator {
return null; return null;
} }
private void loadLazyData() {
if (definition.getService() == null) {
return;
}
for (Object o : definition.getDataSet()) {
definition.getService().loadLazyData(o);
}
}
} }

Loading…
Cancel
Save