}
final int elementCount = b.getElementCount();
for (int i = 0; i < elementCount; i++)
{
final ReportElement element = b.getElement(i);
if (element instanceof Band)
{
processRootBand((Band) element);
}
else if (element instanceof Element)
{
final Element e = (Element) element;
final DataSource source = e.getElementType();
if (source instanceof RawDataSource)
{
final ElementStyleSheet style = element.getStyle();
final String oldFormat = (String)
style.getStyleProperty(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING);
if (oldFormat != null && oldFormat.length() > 0)
{
final Object attribute = element.getAttribute
(AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.EXCEL_CELL_FORMAT_AUTOCOMPUTE);
if (Boolean.TRUE.equals(attribute) == false)
{
continue;
}
}
final RawDataSource rds = (RawDataSource) source;
formatSpecification = rds.getFormatString(getRuntime(), e, formatSpecification);
if (formatSpecification.getType() == FormatSpecification.TYPE_DATE_FORMAT ||
formatSpecification.getType() == FormatSpecification.TYPE_DECIMAL_FORMAT)
{
style.setStyleProperty
(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING, formatSpecification.getFormatString());
element.setAttribute
(AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.EXCEL_CELL_FORMAT_AUTOCOMPUTE,
Boolean.TRUE);
}
}
}