{
return;
}
final ProcessingContext processingContext = getRuntime().getProcessingContext();
final ReportDefinition report = state.getReport();
LayouterLevel[] levels = null;
ExpressionRuntime runtime = null;
final OutputProcessorMetaData metaData = renderer.getOutputProcessor().getMetaData();
if (metaData.isFeatureSupported(OutputProcessorFeature.WATERMARK_SECTION))
{
renderer.startSection(Renderer.TYPE_WATERMARK);
// a new page has started, so reset the cursor ...
// Check the subreport for sticky watermarks ...
levels = DefaultOutputFunction.collectSubReportStates(state, processingContext);
for (int i = levels.length - 1; i >= 0; i -= 1)
{
final LayouterLevel level = levels[i];
final ReportDefinition def = level.getReportDefinition();
final Watermark watermark = def.getWatermark();
if (watermark.isSticky())
{
if (isPageHeaderPrinting(watermark, state))
{
print(level.getRuntime(), watermark);
}
else
{
printEmptyRootLevelBand();
}
}
}
// 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);
}
print(runtime, b);
}
/**
* Dive into the pending group to print the group header ...
*/
for (int i = levels.length - 1; i >= 0; i -= 1)
{
final LayouterLevel level = levels[i];
final ReportDefinition def = level.getReportDefinition();
for (int gidx = 0; gidx < level.getGroupIndex(); gidx++)
{
final Group g = def.getGroup(gidx);
final GroupHeader header = g.getHeader();
if (header.isSticky())
{
if (header.isRepeat())
{
print(level.getRuntime(), header);
}
else
{
printEmptyRootLevelBand();
}
}
}
if (level.isInItemGroup())
{
final DetailsHeader detailsHeader = def.getDetailsHeader();
if (detailsHeader.isRepeat())
{
print(level.getRuntime(), detailsHeader);
}
}