Jump to content

jrxml: how to represent the field of the arrayList


jasperbox

Recommended Posts

I have the array list of Person, and each person has the array list of phone list. In Java code I used JRBeanCollectionDataSource to populate the list of Person.

The followings are the classes. I have no problem to print the lastName and firstName ($F{lastName}) in jrxml, but I got troubles in the phoneList. Any ideas how to represent Person.phoneList.phoneType
or even worse that Person.phoneList.addressList.address in jrxml? Please help advise. thanks a lot!!!!

net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : phoneType

<field name="phoneType" class="java.lang.String"/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{phoneType}]]></textFieldExpression>


public class Person
{
    private String lastName;
    private String firstName;
    private List<Phone> phoneList = new ArrayList<Phone>();
    .....
}

public class Phone
{
    private String phoneType;
    private String phoneNumber;
    private List<Address> addressList = new ArrayList<Address>();
}

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...