If the report has no groups the JRBaseReport.getAllBands fails with NullPointerException at the line 704. The couse is that mainDataset.getGroups() returns null.
Solution may be:
if (mainDataset.getGroups()!=null) { //--ADD line
for (JRGroup group : mainDataset.getGroups())
{
addBands(group.getGroupHeaderSection(), bands);
addBands(group.getGroupFooterSection(), bands);
}
} //--ADD line
Recommended Comments