13.07.2015 Views

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Code Example 11-1PersonBean example, continued}public String getName(){return name;}Your class, which you will name TestFactory, will be something similar to this:Code Example 11-2PersonBean example - Class resultpublic class TestFactory{public static java.util.Collection generateCollection(){java.util.Vector collection = new java.util.Vector();collection.add(new PersonBean("Ted", 20) );collection.add(new PersonBean("Jack", 34) );collection.add(new PersonBean("Bob", 56) );collection.add(new PersonBean("Alice",12) );collection.add(new PersonBean("Robin",22) );collection.add(new PersonBean("Peter",28) );}}return collection;Your data source will represent five JavaBeans of PersonBean type.The parameters for the data source configuration will be as follows (see Figure 11-15):• Factory name: “TestFactory?• Factory class: TestFactory• Method to call: generateCollection• Return type: Collection of JavaBean184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!