// 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);