{
JRCrosstabCell[][] cells = crosstab.getCells();
JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
JRCrosstabColumnGroup[] columnGroups = crosstab.getColumnGroups();
JRCrosstabCell baseCell = cells[rowGroups.length][columnGroups.length];
if(baseCell == null || baseCell.getWidth() == null)
{
addBrokenRule("Crosstab base cell width not specified.", crosstab);
}
if(baseCell == null || baseCell.getHeight() == null)
{
addBrokenRule("Crosstab base cell height not specified.", crosstab);
}
for (int i = rowGroups.length; i >= 0 ; --i)
{
for (int j = columnGroups.length; j >= 0 ; --j)
{
JRCrosstabCell cell = cells[i][j];
String cellText = getCrosstabCellText(rowGroups, columnGroups, i, j);
if (cell != null)
{
JRCellContents contents = cell.getContents();
if (i < rowGroups.length)
{
JRCrosstabCell colCell = cells[rowGroups.length][j];
if (colCell != null && colCell.getContents().getWidth() != contents.getWidth())
{
addBrokenRule("Crosstab " + cellText + " width should be " + colCell.getContents().getWidth() + ".", cell);
}
}
if (j < columnGroups.length)
{
JRCrosstabCell rowCell = cells[i][columnGroups.length];
if (rowCell != null && rowCell.getContents().getHeight() != contents.getHeight())
{
addBrokenRule("Crosstab " + cellText + " height should be " + rowCell.getContents().getHeight() + ".", cell);
}
}
verifyCellContents(contents, cellText);
}