{
final CrosstabElement crosstabElement = (CrosstabElement)reportDefinition;
final Group group = crosstabElement.getRootGroup();
if (group instanceof CrosstabGroup)
{
final CrosstabGroup crosstabGroup = (CrosstabGroup)group;
final GroupBody crosstabGroupBody = crosstabGroup.getBody();
// Start with the other group and work our way deeper recursively.
// Note: Other Group is optional.
if (crosstabGroupBody instanceof CrosstabOtherGroupBody)
{
final CrosstabOtherGroup crosstabOtherGroup = ((CrosstabOtherGroupBody)crosstabGroupBody).getGroup();
buildCrosstabOtherRowGroupBands(crosstabOtherGroup);
}
else if (crosstabGroupBody instanceof CrosstabRowGroupBody)
{
final CrosstabRowGroupBody crosstabRowGroupBody = (CrosstabRowGroupBody)crosstabGroup.getBody();
buildCrosstabRowGroupBands(crosstabRowGroupBody);
}
// Create an array of all elements.
allElementsList.addAll(otherGroupBodyList);