}
}
}
// and finally print the watermark of the subreport itself ..
final Band watermark = report.getWatermark();
if (isPageHeaderPrinting(watermark, state))
{
runtime = createRuntime(state.getFlowController().getMasterRow(), state, processingContext);
print(runtime, watermark);
}
addSubReportMarkers(renderer.endSection());
}
if (metaData.isFeatureSupported(OutputProcessorFeature.PAGE_SECTIONS))
{
renderer.startSection(Renderer.TYPE_HEADER);
// after printing the watermark, we are still at the top of the page.
if (levels == null)
{
levels = DefaultOutputFunction.collectSubReportStates(state, processingContext);
}
for (int i = levels.length - 1; i >= 0; i -= 1)
{
// This is propably wrong (or at least incomplete) in case a subreport uses header or footer which should
// not be printed with the report-footer or header ..
final LayouterLevel level = levels[i];
final ReportDefinition def = level.getReportDefinition();
final PageHeader header = def.getPageHeader();
if (header.isSticky())
{
if (isPageHeaderPrinting(header, state))
{
print(level.getRuntime(), header);
}
else
{
printEmptyRootLevelBand();
}
}
}
// and print the ordinary page header ..
final Band b = report.getPageHeader();
if (isPageHeaderPrinting(b, state))
{
if (runtime == null)
{
runtime = createRuntime(state.getFlowController().getMasterRow(), state, processingContext);