I have to make a report in jasperReports
I fill my initial report with a DataSource like this
File mainJasper = new File( servletContext.getRealPath("/WEB-INF/prueba.jasper") );
Map<String,Object> parametros = new HashMap<String, Object>();
parametros.put("numLista", numLista );
parametros.put("txtDestino", pas.getLista().getCiudadDestino());
parametros.put("txtFecLlegada", pas.getLista().getFecLleLista().toString());
parametros.put("txtProcedencia", pas.getLista().getCiudadProcedencia() );
parametros.put("txtNombres", con.getPersona().getNomPersona() );
parametros.put("txtFecNac", con.getPersona().getFecNacPersona().toString() );
parametros.put("txtTipoDoc", con.getPersona().getParametrica().getNomParametrica());
parametros.put("txtNroBrevete", con.getNumBrevConductor() );
parametros.put("txtOcupacion", con.getPersona().getProPersona() );
parametros.put("txtApellidos", con.getPersona().getApePatPersona() + " " +con.getPersona().getApeMatPersona() );
parametros.put("txtDomicilio", con.getPersona().getDirPersona() );
parametros.put("txtNumDoc", con.getPersona().getNumDoc() );
parametros.put("txtNacionalidad", con.getPersona().getPais().getNomPais() );
parametros.put("txtEstCivil", con.getPersona().getEstCivPersona() );
JasperReport mainReporte = (JasperReport) JRLoader.loadObject(mainJasper);
JasperPrint mainPrint = JasperFillManager.fillReport(mainReporte, parametros, new JRBeanCollectionDataSource(List1));
JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, mainPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE, new java.io.File("new.pdf"));
exporter.exportReport();
that code works fine, but i have another list, and i want to have two details in my report
My List are
List1 wich actually works
List2 that is my other list
How can i pass this other list? Also i have a subreport in my .jxrml but this two list are of differents object