" new field.");
}
public void installIntoReport(final AbstractReportDefinition report) throws ParseException
{
final GroupDataBody originalGroupDataBody = (GroupDataBody) report.getChildElementByType(GroupDataBodyType.INSTANCE);
if (originalGroupDataBody == null)
{
throw new ParseException("The report is not a relational report, cannot install relational detail sections here");
}
final ItemBand ib = originalGroupDataBody.getItemBand();
final NoDataBand nd = originalGroupDataBody.getNoDataBand();
final DetailsHeader detailsHeader = originalGroupDataBody.getDetailsHeader();
final DetailsFooter detailsFooter = originalGroupDataBody.getDetailsFooter();
final Group newRootGroup = constructRootGroup();
if (report.getRootGroup() == newRootGroup)
{
return;
}
report.setRootGroup(newRootGroup);
final GroupDataBody groupDataBody = (GroupDataBody) newRootGroup.getChildElementByType(GroupDataBodyType.INSTANCE);
if (groupDataBody == null)
{
return;
}
groupDataBody.setDetailsFooter(detailsFooter);
groupDataBody.setDetailsHeader(detailsHeader);
groupDataBody.setItemBand(ib);
groupDataBody.setNoDataBand(nd);
}