Τεκμηρίωση HotXLS

AfterCell γεγονός

Occurs after the field specified by FieldIndex of the current record is saved into the cell

Περιγραφή

You can use this event to apply conditional formatting to any exported cell in the detail area

Σύνταξη

TAfterCell = procedure (Sender: TObject; Cell: IXLSRange; RowIndex, FieldIndex: Integer; Field: TField) of object;
Sender TObject. Καθορίζει the TDataToXLS component that triggered the event
Cell IXLSRange. Αντιπροσωπεύει the cell which is exported
RowIndex Integer. The index of the current row
FieldIndex Integer. The index of the field
Field TField. An object that represents the field of dataset

Παράδειγμα

This example sets the interior color for odd columns to silver

procedure TForm1.DataToXLS1AfterCell(Sender: TObject;
  Cell: IXLSRange; RowIndex, FieldIndex: Integer; Field: TField);
begin
  if Odd(FieldIndex + 1) then Cell.Interior.Color := ColorToRGB(clSilver);
end;