[英]Do Jasper support xml file as the datasource?
我想知道JasperServer是否接受xml文件作為報告數據源,以及我們是否可以在我們對adhoc報告創建者中的各種數據源執行的xml節點上執行相同的操作,如拖放等等?
以下是我為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>");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.