if (m_aGroupNames == null)
{
return;
}
final XGroups xGroups = getReportDefinition().getGroups();
final int nLeftPageIndent = getLeftPageIndent();
final int nLabelWidth = getMaxLabelWidth(); // 3000;
final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
final int nFieldWidth = nUsablePageWidth - nLabelWidth;
// after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it.
XGroup aLastGroup = null;
for (int i = 0; i < m_aGroupNames.length; i++)
{
final XGroup xGroup = xGroups.createGroup();
aLastGroup = xGroup;
// TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname"
xGroup.setExpression(m_aGroupNames[i]);
xGroup.setHeaderOn(true);
// we don't want any group footer (default off)
// xGroup.setFooterOn(true);
try
{
// we need to append by hand
// TODO: documentation is unclear here, that we have to insert by hand
int nCount = xGroups.getCount();
xGroups.insertByIndex(nCount, xGroup);
final XSection xGroupSection = xGroup.getHeader();
copyGroupProperties(nCount);
Rectangle aRect = new Rectangle();