#14 Add DATA_SOURCE_ORIGIN_CUSTOM

open
nobody
5
2012-12-07
2009-09-03
Stefano Travelli
No

I have a use case where the expression to be set as the data source origin for a subreport cannot be obtained with one of the provided types (field, parameter, sql connection, report datasource or parameters map).

I worked a patch that add DATA_SOURCE_ORIGIN_CUSTOM, so that I can write:

subReportBuilder.setDataSource(DJConstants.DATA_SOURCE_ORIGIN_CUSTOM,
DJConstants.DATA_SOURCE_TYPE_COLLECTION,
"new " +JRBeanCollectionDataSource.class.getName() + "( java.util.Collections.singletonList($F{prefattura}))");

In this case I wanted a single record subreport in order to show some extra details in the group.

If you think this is valuable, please find the attached patch that can be applied to the current codebase (3.0.11-beta1).

Discussion

  • Any chance to get this patch included?