{
JRCrosstabRowGroup[] groups = crosstab.getRowGroups();
for (int i = 0, x = 0, y = 0; i < groups.length; i++)
{
JRCrosstabRowGroup group = groups[i];
if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.START)
{
JRCellContents totalHeader = group.getTotalHeader();
if (totalHeader.getWidth() != 0 && totalHeader.getHeight() != 0)
{
crosstabElements.add(
getCrosstabCellFrame(
reportConverter,
totalHeader,
x,
colHeadersYOffset + y,
false,
false,
y == 0 && crosstab.getHeaderCell() == null
));
addCrosstabDataCellsRow(
reportConverter,
crosstab,
rowHeadersXOffset,
colHeadersYOffset + y,
i,
crosstabElements
);
y += totalHeader.getHeight();
}
}
JRCellContents header = group.getHeader();
if (header.getWidth() != 0 && header.getHeight() != 0)
{
crosstabElements.add(
getCrosstabCellFrame(
reportConverter,
header,
x,
colHeadersYOffset + y,
false,
false,
y == 0 && crosstab.getHeaderCell() == null
));
}
if (i == groups.length - 1)
{
addCrosstabDataCellsRow(
reportConverter,
crosstab,
rowHeadersXOffset,
colHeadersYOffset + y,
groups.length,
crosstabElements
);
}
if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.END)
{
JRCellContents totalHeader = group.getTotalHeader();
if (totalHeader.getWidth() != 0 && totalHeader.getHeight() != 0)
{
crosstabElements.add(
getCrosstabCellFrame(
reportConverter,
totalHeader,
x,
colHeadersYOffset + y + header.getHeight(),
false,
false,
false
));
addCrosstabDataCellsRow(
reportConverter,
crosstab,
rowHeadersXOffset,
colHeadersYOffset + y + header.getHeight(),
i,
crosstabElements
);
}
}
x += group.getWidth();
}
}