}
}
protected FillTableSubreport createFillTableSubreport() throws JRException
{
JasperReport parentReport = fillContext.getFiller().getJasperReport();
JRDataset reportSubdataset = JRReportUtils.findSubdataset(table.getDatasetRun(),
parentReport);
Map<JRExpression, BuiltinExpressionEvaluator> builtinEvaluators =
new HashMap<JRExpression, BuiltinExpressionEvaluator>();
String tableReportName = JRAbstractCompiler.getUnitName(parentReport, reportSubdataset);
// clone the table subdataset in order to have a different instance for other
// elements that might be using it.
// we're cloning the subdataset via an object factory in order to preserve
// the relationship between objects (e.g. variables and groups) in the cloned
// dataset
JRDataset tableSubdataset = DatasetCloneObjectFactory.cloneDataset(reportSubdataset);
TableReportDataset reportDataset = new TableReportDataset(tableSubdataset, tableReportName);
TableReport tableReport = new TableReport(fillContext, reportDataset, fillColumns, builtinEvaluators);
if (log.isDebugEnabled())
{
String tableReportXml = JRXmlWriter.writeReport(tableReport, "UTF-8");
log.debug("Generated table report:\n" + tableReportXml);
}
JRReportCompileData tableReportCompileData = createTableReportCompileData(
parentReport, reportSubdataset);
JasperReport compiledTableReport = new JasperReport(tableReport,
parentReport.getCompilerClass(),
tableReportCompileData,
new TableReportBaseObjectFactory(reportDataset),
"");// no suffix as already included in the report name