private void verifyGroupHeaderAndFooter(JRGroup group)
{
if (jasperDesign.isTitleNewPage())
{
JRSection groupHeaderSection = group.getGroupHeaderSection();
if (groupHeaderSection != null)
{
JRBand[] groupHeaderBands = groupHeaderSection.getBands();
if (groupHeaderBands != null && groupHeaderBands.length > 0)
{
for(int i = 0; i< groupHeaderBands.length; i++)
{
JRBand groupHeaderBand = groupHeaderBands[i];
if (
jasperDesign.getTopMargin() +
(jasperDesign.getPageHeader() != null ? jasperDesign.getPageHeader().getHeight() : 0) +
(jasperDesign.getColumnHeader() != null ? jasperDesign.getColumnHeader().getHeight() : 0) +
getBreakHeight(groupHeaderBand) +
(jasperDesign.getColumnFooter() != null ? jasperDesign.getColumnFooter().getHeight() : 0) +
(jasperDesign.getPageFooter() != null ? jasperDesign.getPageFooter().getHeight() : 0) +
jasperDesign.getBottomMargin() >
jasperDesign.getPageHeight()
)
{
addBrokenRule("The '" + group.getName() + "' group header section, the page and column headers and footers and the margins do not fit the page height.", groupHeaderBand);
}
}
}
}
JRSection groupFooterSection = group.getGroupFooterSection();
if (groupFooterSection != null)
{
JRBand[] groupFooterBands = groupFooterSection.getBands();
if (groupFooterBands != null && groupFooterBands.length > 0)
{
for(int i = 0; i< groupFooterBands.length; i++)
{
JRBand groupFooterBand = groupFooterBands[i];
if (
jasperDesign.getTopMargin() +
(jasperDesign.getPageHeader() != null ? jasperDesign.getPageHeader().getHeight() : 0) +
(jasperDesign.getColumnHeader() != null ? jasperDesign.getColumnHeader().getHeight() : 0) +
getBreakHeight(groupFooterBand) +
(jasperDesign.getColumnFooter() != null ? jasperDesign.getColumnFooter().getHeight() : 0) +
(jasperDesign.getPageFooter() != null ? jasperDesign.getPageFooter().getHeight() : 0) +
jasperDesign.getBottomMargin() >
jasperDesign.getPageHeight()
)
{
addBrokenRule("The '" + group.getName() + "' group footer section, the page and column headers and footers and the margins do not fit the page height.", groupFooterBand);
}
}
}
}
}
else
{
JRSection groupHeaderSection = group.getGroupHeaderSection();
if (groupHeaderSection != null)
{
JRBand[] groupHeaderBands = groupHeaderSection.getBands();
if (groupHeaderBands != null && groupHeaderBands.length > 0)
{
for(int i = 0; i< groupHeaderBands.length; i++)
{
JRBand groupHeaderBand = groupHeaderBands[i];
if (
jasperDesign.getTopMargin() +
(jasperDesign.getTitle() != null ? jasperDesign.getTitle().getHeight() : 0) +
(jasperDesign.getPageHeader() != null ? jasperDesign.getPageHeader().getHeight() : 0) +
(jasperDesign.getColumnHeader() != null ? jasperDesign.getColumnHeader().getHeight() : 0) +
getBreakHeight(groupHeaderBand) +
(jasperDesign.getColumnFooter() != null ? jasperDesign.getColumnFooter().getHeight() : 0) +
(jasperDesign.getPageFooter() != null ? jasperDesign.getPageFooter().getHeight() : 0) +
jasperDesign.getBottomMargin() >
jasperDesign.getPageHeight()
)
{
addBrokenRule("The '" + group.getName() + "' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.", groupHeaderBand);
}
}
}
}
JRSection groupFooterSection = group.getGroupFooterSection();
if (groupFooterSection != null)
{
JRBand[] groupFooterBands = groupFooterSection.getBands();
if (groupFooterBands != null && groupFooterBands.length > 0)
{
for(int i = 0; i< groupFooterBands.length; i++)
{
JRBand groupFooterBand = groupFooterBands[i];