if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "image", attrs))
{
return;
}
final XmlWriter xmlWriter = getXmlWriter();
if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs))
{
if (variables != null)
{
// This cannot happen as long as the report sections only contain tables. But at some point in the
// future they will be made of paragraphs, and then we are prepared ..
//Log.debug("Variables-Section " + variables);
if (sectionKeepTogether == true && expectedTableRowCount > 0)
{
StyleUtilities.copyStyle("paragraph",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
getGlobalStylesCollection(), getPredefinedStylesCollection());
xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
xmlWriter.writeText(variables);
xmlWriter.writeCloseTag();
variables = null;
}
else
{
StyleUtilities.copyStyle("paragraph",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT, getStylesCollection(),
getGlobalStylesCollection(), getPredefinedStylesCollection());
xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT, XmlWriterSupport.OPEN);
xmlWriter.writeText(variables);
xmlWriter.writeCloseTag();
variables = null;
}
}
// Only generate the empty paragraph, if we have to add the keep-together ..
else if (cellEmpty && expectedTableRowCount > 0 &&
sectionKeepTogether == true && firstCellSeen == false)
{
// we have no variables ..
StyleUtilities.copyStyle("paragraph",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
getGlobalStylesCollection(), getPredefinedStylesCollection());
xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.CLOSE);
}
}
if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs))
{
firstCellSeen = true;
}
else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "covered-table-cell", attrs))
{
firstCellSeen = true;
}
if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table", attrs))
{
if (getCurrentRole() == ROLE_DETAIL)
{
if (isTableMergeActive() == false)
{
// We do not merge the detail bands, so an ordinary close will do.
xmlWriter.writeCloseTag();
}
else if (detailBandProcessingState == DETAIL_SECTION_FIRST_STARTED)
{
final int keepTogetherState = getCurrentContext().getKeepTogether();
if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL)
{
xmlWriter.writeCloseTag();
detailBandProcessingState = DETAIL_SECTION_FIRST_PRINTED;
}
else
{
detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
}
}
else if (detailBandProcessingState == DETAIL_SECTION_OTHER_STARTED)
{
detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
}
}
else
{
xmlWriter.writeCloseTag();
}
if (isSectionPagebreakAfter(attrs))
{
setPagebreakDefinition(new PageBreakDefinition(false));
}
}
else
{
xmlWriter.writeCloseTag();
}
}