public void groupStarted(final ReportEvent event)
{
final ReportState state = event.getState();
if (event.getLevel() == getDependencyLevel())
{
final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
if (group instanceof CrosstabGroup)
{
final CrosstabGroup crosstabGroup = (CrosstabGroup) group;
// yeay! we encountered a crosstab.
if (processingStack == null)
{
processingStack = new FastStack();
}
final String[] columnSet = computeColumns(crosstabGroup);
final ReportStateKey processKey = state.getProcessKey();
final DataSchema dataSchema = getRuntime().getDataSchema();
final DataAttributes tableAttributes = dataSchema.getTableAttributes();
final DataAttributeContext context = new DefaultDataAttributeContext
(getRuntime().getProcessingContext().getOutputProcessorMetaData(),
getRuntime().getResourceBundleFactory().getLocale());
final String mode = (String) tableAttributes.getMetaAttribute
(MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.CROSSTAB_MODE, String.class, context);
if ("normalized".equals(mode))
{
processingStack.push(new OrderedMergeCrosstabSpecification(processKey, columnSet));
}
else
{
processingStack.push(new SortedMergeCrosstabSpecification(processKey, columnSet));
}
return;
}
if (processingStack == null || processingStack.isEmpty())
{
return;
}
final CrosstabSpecification csstate = (CrosstabSpecification) processingStack.peek();
if (csstate == null)
{
return;
}
if (group instanceof CrosstabRowGroup)
{
if (group.getBody() instanceof CrosstabColumnGroupBody)
{
csstate.startRow();
}
}
return;
}
if (results == null || processingStack == null || processingStack.isEmpty())
{
return;
}
// recall ..
final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
if (group instanceof CrosstabGroup)
{
final ReportStateKey processKey = state.getProcessKey();
final CrosstabSpecification o = (CrosstabSpecification) results.get(processKey);
if (o == null)