How do we create JRBeanCollectionDataSource from pojo class which is structured as follows

0
class Employee {
  String empName;
  Address homeaddress
}
class Address{
  string streetName
}
 
we have to display employee records in table using JasperReports.
 
We created JRBeanCollectionDataSource as following
 
JRBeanCollectionDataSource jrBeanCollectionDataSource = new JRBeanCollectionDataSource(employee);
 
params.put("employeeDataSource", jrBeanCollectionDataSource );
 
JasperPrint jasperPrint = JasperFillManager.fillReport(jreport, params, jrBeanCollectionDataSource);
 
When i access streetName in my jrxml. I get error streeName not found in object employee.
 
How to access child objects in jrxml using JRBeanCollectionDataSource?
2340patel's picture
Joined: Jan 11 2018 - 8:38pm
Last seen: 5 months 1 week ago

0 Answers:

No answers yet
Feedback