เกิดขึ้นหลังจากบันทึกฟิลด์ที่ระบุโดย FieldIndex ของระเบียนปัจจุบันลงในเซลล์
ไวยากรณ์
ตัวอย่างนี้ตั้งค่าสีพื้นหลังของเซลล์บางเซลล์ในอีเวนต์ AfterCell
ตัวอย่าง
TAfterCell =
procedure (Sender: TObject; Cell:
IXLSRange; RowIndex, FieldIndex: Integer; Field: TField) of object;
| Sender |
TObject. ระบุ TDataToXLS component that triggered event |
| Cell |
IXLSRange. แทน เซลล์ which is exported |
| RowIndex |
Integer. ดัชนี ของ current แถว |
| FieldIndex |
Integer. ดัชนี ของ field |
| Field |
TField. object that represents field ของ 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;