我创建了报告,将数据传递给维护报告,但我坚持在这里。
如何将列表或HashMap传递给subReport?
这是我的代码:
JasperReport jasperReport = null;
JasperPrint jasperPrint = null;
JasperDesign jasperDesign = null;
Map parameters = new HashMap();
parameters.put("name_user", "ShahzaibAli sha");
parameters.put("address_user", "Rustam");
jasperDesign = JRXmlLoader.load("C:\\Users\\Tajmirkhan\\Documents\\NetBeansProjects\\Shahzaib\\src\\shahzaib\\report1.jrxml");
jasperReport = JasperCompileManager.compileReport(jasperDesign);
jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jasperPrint,"StudentInfo.pdf");
JasperViewer.viewReport(jasperPrint);