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

comco

Members
  • Posts

    2
  • Joined

  • Last visited

comco's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Since no one answered, after a quick brainstorm, here's the answer: JasperReports expects a JRDataSource as a source for the table, passing it an Phone[] doesn't work: $F{phones} We have to create some kind of data source in the "Connection/Datasource exp". For example, we use: new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource(java.util.Arrays.asList($F{phones})) and it works like a charm!
  2. Here's my scenario: I'm generating reports from java beans and I have bean data like this: class Person { public String getName(); public String getAge(); public Phone[] getPhones(); } class Phone { public String getCountrySuffix(); public String getRegionCode(); public String getPrefix(); } I'm using a beans datasource for the designer as this: class Person_DataFactory { public static Person[] generateBeans() { Phone p1 = new Phone("p1", "q1", "r1"); Phone p2 = new Phone("p1", "q1", "r1"); Phone p3 = new Phone("p1", "q1", "r1"); Person p = new Person("name", "29", new Phone[] { p1, p2, p3 }); return new Person[] { p }; } } Now, I'm able to get the Person fields on the report. But I want for each person in the report a table containing its phones. How can this be done?
×
×
  • Create New...