好的,这就是它的工作原理。
JasperFillManager实际上返回一个
JasperPrint对象,因此:
// get the JRXML template as a streamInputStream template = JasperReportsApplication.class .getResourceAsStream("/sampleReport.xml");// compile the report from the streamJasperReport report = JasperCompileManager.compileReport(template);// fill out the report into a print object, ready for export. JasperPrint print = JasperFillManager.fillReport(report, new HashMap<String, String>());// export it!File pdf = File.createTempFile("output.", ".pdf");JasperExportManager.exportReportToPdfStream(print, new FileOutputStream(pdf));
请享用。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)