We have 4 list objects as shown below.
List<Discharge> list19a= ddao.getHis(req.getParameter("pid"),"diagnose"); // diag detail, prov diag, dis summ
List<Discharge> list6a = ddao.getPrescription2His(req.getParameter("pid")); //patho inv recomm
List<Discharge> list5a = ddao.getPrescriptionTabHis(req.getParameter("pid")); // prescription, advice
List<Discharge> listfil= dao.getRetrfilesHis(req.getParameter("pid")); // uploaded files
Now we want to pass all these lists to Jasper report. Below is the code where we are using JRDataSource to pass the list. But the below code works fine for only one list, but how to pass all the above lists to Jasper report.
Map<String,Object> parameterMap = new HashMap<String,Object>();
parameterMap.put("realName",realName);
JRDataSource JRdataSource = new JRBeanCollectionDataSource(list19a);
JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameterMap, JRdataSource);
OutputStream out = response.getOutputStream();
JasperExportManager.exportReportToPdfStream(jasperPrint,out);
Help Appreciated!