我想知道 JasperServer 是否接受 xml 文件作为报表数据源,以及我们是否可以在 xml 节点上执行我们在临时报表创建器中对各种数据源执行的相同操作,例如拖放等?
问问题
3215 次
2 回答
0
这是我为 xml 文件作为数据源测试的示例代码,输出是 PDF 报告:
JasperReport jasperReport = JasperCompileManager.compileReport("<Path of jrxml file>");
JRXmlDataSource xmlDataSource = new JRXmlDataSource("<Path of xml file>", "XPath Query");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), xmlDataSource);
JasperExportManager.exportReportToPdfFile(jasperPrint, "<Path of file PDF output file>");
于 2012-02-09T13:23:43.440 回答