Export JasperReport to PDF OutputStream?
2022-09-01 07:18:50
我正在编写一个非常简单的示例项目,以熟悉Jasper Reports。我想将已配置的报表导出为 PDF ,但没有工厂方法:OutputStream
InputStream template = JasperReportsApplication.class
.getResourceAsStream("/sampleReport.xml");
JasperReport report = JasperCompileManager.compileReport(template);
JasperFillManager.fillReport(report, new HashMap<String, String>());
// nope, just chuck testa.
//JasperExportManager.exportReportToPdfStream(report, new FileOutputStream(new File("/tmp/out.pdf")));
如何获取 PDF 格式?OutputStream