}
private LayoutController processFooter(final ReportTarget target)
throws ReportProcessingException, DataSourceException, ReportDataFactoryException
{
final AutoTableElement node = (AutoTableElement) getElement();
if (node.getFooterCount() == 0)
{
final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
derived.currentColumn = 0;
derived.processingState = -1;
derived.setProcessingState(ElementLayoutController.FINISHING);
return derived;
}
if (currentColumn == 0)
{
// Start a new table-header section ..
final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
(AutoTableModule.AUTOTABLE_NAMESPACE, "footer-row");
target.startElement(elementMap);
}
if (currentColumn < columnCount)
{
// now delegate the processing to the section handler for the header ..
final FlowController flowController = getFlowController();
final ReportContext reportContext = flowController.getReportContext();
final LayoutControllerFactory layoutControllerFactory =
reportContext.getLayoutControllerFactory();
final int idx = currentColumn % node.getFooterCount();
final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
return layoutControllerFactory.create
(flowController, node.getFooterCell(idx), derived);
}
// close the table-header section ..
final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
(AutoTableModule.AUTOTABLE_NAMESPACE, "footer-row");