HotXLS Docs

BeforeValue property

Occurs before a field value is written, so you can transform or format the value prior to export

Syntax

TBeforeValue = procedure(Sender: TObject; DataSet: TDataSet; Field: TField; Level, SourceFieldIndex, ExportColumnIndex: Integer; var Value: Variant; var ExportValue: Boolean) of object; property BeforeValue: TBeforeValue read FBeforeValue write FBeforeValue;
Sender TObject. The TDataToXLS component that raised the event
DataSet TDataSet. The dataset supplying the current record
Field TField. The field whose value is about to be written
Level Integer. Zero for the master dataset, larger values for nested detail datasets
SourceFieldIndex Integer. Zero-based index of Field within DataSet.Fields
ExportColumnIndex Integer. Zero-based index of the destination column among the exported fields
Value Variant. The value that will be written; assign a replacement to change it
ExportValue Boolean. Set to False to leave the cell empty; True writes Value

Example

This example hooks the BeforeValue event handler

DataToXLS.BeforeValue := MyBeforeValueHandler;