parameterDefinitions = null;
parameterRow = new ParameterDataRow();
}
final Expression[] expressions = parent.getExpressions().getExpressions();
final DataSchemaCompiler dataSchemaCompiler =
new DataSchemaCompiler(dataSchemaDefinition, dataAttributeContext, masterReportElement.getResourceManager());
try
{
final CachingDataFactory dataFactory = new CachingDataFactory(createDataFactory(parent), true);
final MasterReport masterReport = masterReportElement;
dataFactory.initialize(masterReport.getConfiguration(), masterReport.getResourceManager(),
masterReport.getContentBase(), MasterReport.computeAndInitResourceBundleFactory
(masterReport.getResourceBundleFactory(), masterReport.getReportEnvironment()));
dataFactory.open();
try
{
final TableModel reportData = queryReportData(parent.getQuery(), parent.getQueryTimeout(), dataFactory);
final DataSchema dataSchema = dataSchemaCompiler.compile
(reportData, expressions, parameterRow, parameterDefinitions, masterReport.getReportEnvironment());
this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
if (reportData instanceof CloseableTableModel)
{
final CloseableTableModel ctm = (CloseableTableModel) reportData;
ctm.close();
}
return dataSchema;
}
finally
{
dataFactory.close();
}
}
catch (final ReportDataFactoryException rdfe)
{
final TableModel reportData = new DefaultTableModel();
final DataSchema dataSchema = dataSchemaCompiler.compile
(reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
this.dataFactoryException = rdfe;
return dataSchema;
}
catch (ReportProcessingException e)
{
final TableModel reportData = new DefaultTableModel();
final DataSchema dataSchema = dataSchemaCompiler.compile
(reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
this.dataFactoryException = e;
return dataSchema;
}