I have two different classes, One is Person and another one is Address. The Person class has an object of Address class as one of its property. For example
class Person{
String name;
Address address;
}
I cannot change the structure of the class and cannot add any new collections because of other problems.
My problem is, I want to use objects of Person class as datasource for my JasperReports's report which has fields from both Person and Address Class. Can Somebody Please Help
You can try something like this:
Declare only the instances variables of the Person class as jasper reports fields: one field will be "name" of type java.lang.String and another field will be "address" of type your.package.Address (that's it).
Then, if you want to print address specific information in the report, create a Text Field square where you want such info to be displayed and use the expression editor to write something like this: $F{address}.getZipCode() (assuming that Address class has such method and you want to print such info)...
Hope this help...