Jump to content
JasperReports Library 7.0 is now available ×

How to access nested list properties from Java Bean?


Recommended Posts

public class WebserviceRsp {       private List<Person> persons;}public class Person {   private List<Phone> phones;}public class Phone {   private String type; //business, home, private   private String number;}[/code]


Given the class hirarchie above: how can I print a list of all phone numbers where type = "home"?

Because: when I go to the dataset query builder tab, I can select my bean "WebserviceRsp", and then I can only select the direct fields, eg "persons". But I cannot select a field "person[0].phones.number".

I only want to get the first perons phone numbers is my example.

So, how could I create such a jasper variable that selects the first person item in the list, and then prints all values from a sublist?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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