2001 JI Open Discussion Posted August 21, 2006 Share Posted August 21, 2006 By: Carlos Arturo Quiroga - carlosq Subreport don't show 2005-10-14 14:24hello everybody I making a report wiht a subreport, the is the code: List coleccion= new ArrayList(); JasperReport3 t1 = new JasperReport3(); URL urlMaster = t1.getClass().getResource("extractoCuentas.jasper"); URL urlSubreport = t1.getClass().getResource("garantiasReport.jasper"); // load the master report JasperReport masterReport = null; try { masterReport = (JasperReport) JRLoader.loadObject(urlMaster); } catch (JRException e) { System.exit(3); } // load subreport JasperReport subReport = null; try { subReport = (JasperReport) JRLoader.loadObject(urlSubreport); } catch (JRException e) { System.exit(3); } coleccion = sourceobject.getCollecction(); // report parameters Map masterParams = new HashMap(); masterParams.put("paramname", "paramvalue"); masterParams.put("PortafolioSubreport", subReport); JRBeanCollectionDataSource jrDS = new JRBeanCollectionDataSource(coleccion); // fill the master report and expect fill the subreport JasperPrint masterPrint = null; try { masterPrint = JasperFillManager.fillReport(masterReport, masterParams,jrDS); } catch (JRException e) { System.exit(5); } // show report try { JasperViewer.viewReport(masterPrint, true); } catch (JRException e) { System.exit(6); } and the problem is that the subreport don't show and receive the next error: Error evaluating expression : dataSource_1 Source text : $F{portafolio} I have a field named portafolio type java.lang.Object that point to a coleccion property. can anybody tell me, what is the problem, or tell me how can I make a subreport that ready show. Is urgent for me! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now