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 に答える