JavaBean DataSource doesn't get passed to the sub-sub-report


Hi there,

i'm having trouble finding out how to correctly pass a JavaBean DS to a subsubreport. I have the following Java code:

         JRDataSource javaBeansKapitelDS = new JRBeanCollectionDataSource(BeanFactory.generateKapitelCollection());
         jasperReport = JasperCompileManager.compileReport("JRXML/Subreports.jrxml");
         jasperUnterkapitelReport = JasperCompileManager.compileReport("JRXML/Subreports_subreport1.jrxml");
         jasperEntryReport = JasperCompileManager.compileReport("JRXML/Subreports_subreport1_subreport1.jrxml");
         params.put("SUB_DATASOURCE", BeanFactory.generateUnterKapitelCollection());
         params.put("SUB_SUB_DATASOURCE", BeanFactory.generateEntryCollection());
         jasperPrint = JasperFillManager.fillReport(jasperReport, params, javaBeansKapitelDS);
         JasperExportManager.exportReportToPdfFile(jasperPrint, "output/TestJAVABeansDS.pdf");
In the main report i have a report, which has a subreport, which in turn has its own subreport. In the main report i set the Datasource of the subreport as DataSource Expression "new$P{SUB_DATASOURCE})" and works just fine!
In the subreport i tried doing the same thing for the subsubreport (new$P{SUB_SUB_DATASOURCE})) but i can't pass the SUB_SUB_DATASOURCE parameter from the main report to the subreport in order to use it there. If i define in the main report a parameter for the subreport:
<subreportParameter name="SUB_SUB_DATASOURCE">

i get an exception 

Caused by: java.lang.NoSuchMethodException: Unknown property '' on class 'class jasperreports.datasource.Entry'


Fill 1: exception
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean :
I'm using the latest jasper reports library -5.5.1
So my question is: how do i pass to the subreport the JavaBeansDS in order to use it there for the subsubreport?
Thanks a lot for your time!
alexandru.tigaeru's picture
Joined: May 20 2014 - 1:47am
Last seen: 6 years 1 week ago

0 Answers:

No answers yet