@SuppressWarnings("unchecked") protected void printReport(JasperReport report) throws JRException { JRDataSource dataSource = new JRBandDataDataSource(rootBand); Map<String, Object> params = new HashMap<>(); params.put(CUBA_PARAM, new CubaJRFunction(dataSource)); JasperPrint jasperPrint = JasperFillManager.fillReport(report, params, dataSource); Exporter exporter = createExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.exportReport(); }
@SuppressWarnings("unchecked") protected void printReport(JasperReport report) throws JRException { JRDataSource dataSource = new JRBandDataDataSource(rootBand); Map<String, Object> params = new HashMap<>(); params.put(CUBA_PARAM, new CubaJRFunction(dataSource)); JasperPrint jasperPrint = JasperFillManager.fillReport(report, params, dataSource); Exporter exporter = createExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.exportReport(); }
exporter.setExporterInput(exporterInput);
/** * <p>export.</p> * * @param exporterBuilder a {@link net.sf.dynamicreports.jasper.builder.export.AbstractJasperExporterBuilder} object. * @return a {@link net.sf.dynamicreports.jasper.builder.JasperReportBuilder} object. * @throws net.sf.dynamicreports.report.exception.DRException if any. */ public JasperReportBuilder export(AbstractJasperExporterBuilder<?, ? extends AbstractJasperExporter> exporterBuilder) throws DRException { Validate.notNull(exporterBuilder, "exporterBuilder must not be null"); try { ExporterTransform exporterTransform = new ExporterTransform(exporterBuilder.build()); @SuppressWarnings("unchecked") Exporter<ExporterInput, ?, ?, ?> exporter = (Exporter<ExporterInput, ?, ?, ?>) exporterTransform.transform(); exporter.setExporterInput(new SimpleExporterInput(toJasperPrint())); exporter.exportReport(); } catch (JRException e) { throw new DRException(e); } return this; }
/** * <p>export.</p> * * @param exporterBuilder a {@link net.sf.dynamicreports.jasper.builder.export.AbstractJasperExporterBuilder} object. * @return a {@link net.sf.dynamicreports.jasper.builder.JasperConcatenatedReportBuilder} object. * @throws net.sf.dynamicreports.report.exception.DRException if any. */ public JasperConcatenatedReportBuilder export(AbstractJasperExporterBuilder<?, ? extends AbstractJasperExporter> exporterBuilder) throws DRException { Validate.notNull(exporterBuilder, "exporterBuilder must not be null"); try { ExporterTransform exporterTransform = new ExporterTransform(exporterBuilder.build()); @SuppressWarnings("unchecked") Exporter<ExporterInput, ?, ?, ?> exporter = (Exporter<ExporterInput, ?, ?, ?>) exporterTransform.transform(); exporter.setExporterInput(SimpleExporterInput.getInstance(jasperReportHandler.getPrintList())); exporter.exportReport(); } catch (JRException e) { throw new DRException(e); } return this; } }
exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); ExporterOutput output = writerOutput ? new SimpleWriterExporterOutput(destinationFileName)