תיעוד HotXLS

אירוע AfterCell

מתרחש לאחר שהשדה שצוין על ידי FieldIndex של הרשומה הנוכחית נשמר לתא

תיאור

ניתן להשתמש באירוע זה להחלת עיצוב מותנה על כל תא מיוצא באזור הפרטים

תחביר

TAfterCell = procedure (Sender: TObject; Cell: IXLSRange; RowIndex, FieldIndex: Integer; Field: TField) of object;
Sender TObject. מציין the TDataToXLS component that triggered the אירוע
Cell IXLSRange. מייצג the תא which is exported
RowIndex Integer. The אינדקס of the current שורה
FieldIndex Integer. The אינדקס of the field
Field TField. An אובייקט that represents the field of dataset

דוגמה

דוגמה זו מגדירה את צבע הפנים של עמודות אי-זוגיות לכסוף

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