תיעוד HotXLS

אירוע AfterTitle

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

תיאור

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

תחביר

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

דוגמה

דוגמה זו מגדירה את רוחב העמודה עם אינדקס 2

procedure TForm1.DataToXLS1AfterTitle(Sender: TObject;
  Cell: IXLSRange; FieldIndex: Integer; Field: TField);
begin
  if FieldIndex = 2 then Cell.ColumnWidth := 30;
end;
דוגמה זו מראה כיצד לשנות את הטקסט של כותרת עמודה

procedure TForm1.DataToXLS1AfterTitle(Sender: TObject;
  Cell: IXLSRange; FieldIndex: Integer; Field: TField);
begin
  Cell.Value := StringReplace(Cell.Value, '_', ' ', [rfReplaceAll]);
end;