合并两个Jasper报告

合并两个Jasper报告,第1张

合并两个Jasper报告

这是合并多个碧玉印刷品的示例代码

List<JasperPrint> jasperPrints = new ArrayList<JasperPrint>();// Your pre to get Jasperreport objectsJasperReport jasperReportReport1 = JasperCompileManager.compileReport(jasperDesignReport1);jasperPrints.add(jasperReportReport1);JasperReport jasperReportReport2 = JasperCompileManager.compileReport(jasperDesignReport2);jasperPrints.add(jasperReportReport2);JasperReport jasperReportReport3 = JasperCompileManager.compileReport(jasperDesignReport3);jasperPrints.add(jasperReportReport3);JRPdfExporter exporter = new JRPdfExporter();//Create new FileOutputStream or you can use Http Servlet Response.getOutputStream() to get Servlet output stream// Or if you want bytes create ByteArrayOutputStreamByteArrayOutputStream out = new ByteArrayOutputStream();exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrints);exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);exporter.exportReport();byte[] bytes = out.toByteArray();


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5130234.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-17
下一篇 2022-11-17

发表评论

登录后才能评论

评论列表(0条)

保存