GroupClause clause = new GroupClause();
group.addGroupClause(clause);
int fieldID = MPPUtility.getInt(groupVarData, offset);
FieldType type = FieldTypeUtility.getInstance(fieldID);
clause.setField(type);
// from byte 0 2 byte short int - field type
// byte 3 - entity type 0b/0c
// 4th byte in clause is 1=asc 0=desc
// offset+8=font index, from font bases
// offset+12=color, byte
// offset+13=pattern, byte
boolean ascending = (MPPUtility.getByte(groupVarData, offset + 4) != 0);
clause.setAscending(ascending);
int fontIndex = MPPUtility.getByte(groupVarData, offset + 8);
FontBase fontBase = fontBases.get(Integer.valueOf(fontIndex));
int style = MPPUtility.getByte(groupVarData, offset + 9);
boolean bold = ((style & 0x01) != 0);
boolean italic = ((style & 0x02) != 0);
boolean underline = ((style & 0x04) != 0);
int fontColorIndex = MPPUtility.getByte(groupVarData, offset + 10);
ColorType fontColor = ColorType.getInstance(fontColorIndex);
FontStyle fontStyle = new FontStyle(fontBase, italic, bold, underline, false, fontColor.getColor(), null, BackgroundPattern.SOLID);
clause.setFont(fontStyle);
int colorIndex = MPPUtility.getByte(groupVarData, offset + 12);
ColorType color = ColorType.getInstance(colorIndex);
clause.setCellBackgroundColor(color.getColor());
clause.setPattern(BackgroundPattern.getInstance(MPPUtility.getByte(groupVarData, offset + 13) & 0x0F));
// offset+14=group on
int groupOn = MPPUtility.getShort(groupVarData, offset + 14);
clause.setGroupOn(groupOn);
// offset+24=start at
// offset+40=group interval
Object startAt = null;
Object groupInterval = null;
if (type != null)
{
switch (type.getDataType())
{
case DURATION :
case NUMERIC :
case CURRENCY :
{