Jump to content
We've recently updated our Privacy Statement, available here ×

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


2340patel

Recommended Posts

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?

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...