Documentazione HotXLS

AfterCell evento

Si verifica dopo che il campo specificato da FieldIndex del record corrente viene salvato nella cella

Descrizione

È possibile usare questo evento per applicare la formattazione condizionale a qualsiasi cella esportata nell'area di dettaglio

Sintassi

TAfterCell = procedura (Sender: TObject; Cell: IXLSRange; RowIndex, FieldIndex: Integer; Field: TField) of object;
Sender TObject. Specifica the TDataToXLS component that triggered the event
Cell IXLSRange. Rappresenta 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

Esempio

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;