camptocamp/mapfish-printV3 — pull request #134 by jesseeichar (2014-09-10 00:00:12+00:00)
Title: Add merge datasource processor

Added a new Processor which combines DataSources and individual processor outputs (or attribute values) into a single DataSource which can be used in a jasper report's detail section.

An example use case is where we might have zero or many of tables and zero or many legends. You can configure the template with a detail section that contains a subreport, the name of which is a field in the DataSources and the DataSources for the sub-template another field. Then you can merge the legend and the tables into a single DataSources.
This way the report will nicely expand depending on if you have a legend and how many tables you have in your report.

Example configuration:

- !mergeDataSources
sources:
- !mergeSource
type: SINGLE
fields: # name the column data so there is consistence in all rows
map: subReportPath
- !mergeSource
type: SINGLE
fields: # name the column data so there is consistence in all rows
legendSubReport: subReportPath
legend: datasource
- !mergeSource
key: jrDataSource
type: DATASOURCE
fields:
displayName: displayName
table: datasource # main.jrxml uses the name "datasource" so we need to use that mapping here
reportTemplate: subReportPath