NativeExcel suite v2.x

AfterGroupTitle event

Occurs after the group title specified by Index is exported.

Description

You can use this event to apply additional formatting to the group title area.

Syntax

TDBGridAfterGroupTitle = procedure (Sender: TObject; GroupIndex: integer; GroupRow: IXLSRange; GroupCell: IXLSRange) of object;
SenderTObject. Specifies the TDBGrid2Excel component that triggered the event.
GroupIndexInteger. One-based index of the group.
GroupRowIXLSRange. Represents a range which contains the whole group title area.
GroupCellIXLSRange. Represents a cell which contains the group value.

Example

This example applies additional formatting for the group title area.
procedure TForm1.DBGrid2Excel1AfterGroupTitle(Sender: TObject;
      GroupIndex: integer; GroupRow: IXLSRange; GroupCell: IXLSRange);
begin
  GroupRow.Merge;
  With GroupRow do begin
     case GroupIndex of
        1:   Font.Size := 16;
        2:   Font.Size := 14;
        3:   Font.Size := 12;
        else Font.Size := 10;
     end;
  end;
end;
Copyright © NikaSoft 2004-2010