if (groups != null && groups.length > 0)
{
boolean isMainDataset = dataset.isMainDataset();
for(int index = 0; index < groups.length; index++)
{
JRGroup group = groups[index];
if (group.getName() == null || group.getName().trim().length() == 0)
{
addBrokenRule("Group name missing.", group);
}
if (isMainDataset)
{
verifyGroupHeaderAndFooter(group);
}
else
{
if (
(group.getGroupHeaderSection() != null
&& group.getGroupHeaderSection().getBands() != null
&& group.getGroupHeaderSection().getBands().length > 0)
|| (group.getGroupFooterSection() != null
&& group.getGroupFooterSection().getBands() != null
&& group.getGroupFooterSection().getBands().length > 0)
)
{
addBrokenRule("Group " + group.getName() + " cannot have header or footer sections.", group);
}
}
JRExpression expression = group.getExpression();
if (expression != null)
{
try
{
Class clazz = expression.getValueClass();
if (clazz == null)
{
addBrokenRule("Class not set for group expression : " + group.getName(), expression);
}
}
catch (JRRuntimeException e)
{
addBrokenRule(e, expression);
}
}
if (isMainDataset)
{
verifySection(group.getGroupHeaderSection());
verifySection(group.getGroupFooterSection());
}
}
}
}