我正在编写一个相当简单的示例项目,以熟悉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
中?
exportReportToPdfFile
而不需要自己处理输出流。 - Rangi Lin