I have a need to create a report in DynamicJasper that has multiple "subreports" which contain different columns. The data for the columns is stored in a HashMap on each row Object. I have not found any way in DynamicJasper to specify that a column's value should come from a particular key on the HashMap.
I have found that if I build a single report, I can extend JRAbstractBeanDataSource and create my own Data Source that knows how to get the data correctly based on how I format the field name. However, when I use addConcatenatedReport to add in multiple reports, the "subreports" use JRBeanCollectionDataSource instead of my custom Data Source.
The only solution I have come up with so far is to have a POJO that has a bunch of properties like "column1value" and "column2value" which I preload and use for the field references in the dynamic columns. I really don't want to do this...can anyone think of any other options? Anything I am missing?
Sidenote: any ideas why you can't pass a custom data source type to the addConcatenatedReport function? Technical issues, or it just hasn't been needed? Seems like this would be a common need for a "dynamic" report.