*/
protected void layoutGroups() {
log.debug("Starting groups layout...");
int i = 0;
for (Iterator iter = getReport().getColumnsGroups().iterator(); iter.hasNext();) {
DJGroup columnsGroup = (DJGroup) iter.next();
// JRDesignGroup jgroup = (JRDesignGroup) getDesign().getGroupsList().get(i++);
JRDesignGroup jgroup = getJRGroupFromDJGroup(columnsGroup);
jgroup.setStartNewPage(columnsGroup.getStartInNewPage().booleanValue());
jgroup.setStartNewColumn(columnsGroup.getStartInNewColumn().booleanValue());
JRDesignBand header = (JRDesignBand) jgroup.getGroupHeader();
JRDesignBand footer = (JRDesignBand) jgroup.getGroupFooter();
header.setHeight(columnsGroup.getHeaderHeight().intValue());
footer.setHeight(columnsGroup.getFooterHeight().intValue());
header.setSplitAllowed(columnsGroup.isAllowHeaderSplit());
footer.setSplitAllowed(columnsGroup.isAllowFooterSplit());
if (columnsGroup.getLayout().isPrintHeaders()) {
boolean found = false;
boolean skipPreviousGroupHeaders = false;
int groupIdx = getReport().getColumnsGroups().indexOf(columnsGroup);
if (groupIdx>0){
DJGroup prevG = (DJGroup) getReport().getColumnsGroups().get(groupIdx-1);
skipPreviousGroupHeaders = !prevG.getLayout().isShowValueForEachRow();
}
for (Iterator iterator = getVisibleColumns().iterator(); iterator.hasNext();) {
AbstractColumn col = (AbstractColumn) iterator.next();
//If in a nested group, header for column prior to this groups column