if (repeat != null)
{
footer.setRepeat(repeat.booleanValue());
}
final Band content = AutoGeneratorUtility.findGeneratedContent(footer);
if (content == null)
{
return;
}
final Class aggFunctionClass = groupDefinition.getAggregationFunction();
final Element footerValueElement = AutoGeneratorUtility.generateFooterElement
(aggFunctionClass, computeElementType(groupDefinition),
groupDefinition.getGroupName(), groupDefinition.getField());
final Element footerLabelElement = new Element();
footerLabelElement.setElementType(new LabelType());
if (groupDefinition.getGroupTotalsLabel() != null)
{
footerLabelElement.setAttribute
(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, groupDefinition.getGroupTotalsLabel());
}
else
{
footerLabelElement.setAttribute
(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, groupDefinition.getField());
footerLabelElement.setAttribute
(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, groupDefinition.getField());
footerLabelElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.TRUE);
}
final Band footerElement = new Band();
footerElement.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "inline");
footerElement.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(-100));
footerElement.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
footerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ALLOW_METADATA_STYLING,
Boolean.TRUE);
footerElement.setAttribute
(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, groupDefinition.getField());
footerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, "CachedWizardFormatData", footerDefinition);
footerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, "CachedWizardFieldData", groupDefinition);
footerElement.addElement(footerLabelElement);
footerElement.addElement(footerValueElement);
content.clear();
content.addElement(footerElement);
}