I have a POJO that compiles data from various sources into a single object. The object is instantiated with a single parameter. Example:
Invoice inv=new Invoice(1239);
This will bring back a complete invoice containing other POJOs populated with data from various sources (such as the billing and shipping addresses as Address objects).
Can I use this as a data source within iReport?
You could try use a
JRMapCollectionDataSourcefrom which you can build a DataSource from a collection.You could take the values from the POJO object and place them into a collection if possible.
Here is some sample code for constructing a DataSource.
Another option would be to create a custom datasource by implementing
JRRewindableDataSourceorJRDataSource.