TTMSFMXGridExcelExport.OnExportCell Event
Occurs before exporting every cell, and allows you to customize what is written in it.
Syntax
Unit: FMX.TMSGridExcelExport
property TTMSFMXGridExcelExport.OnExportCell: TExportCellEvent
Examples
To modify the numeric format in column 3, you can use the code:
procedure TExampleForm.TMSFMXGridExcelExport1ExportCell(Sender: TObject;
var Args: TExportCellEventArgs);
var
Fmt: TFlxFormat;
begin
//Format cells in column 3 with a specific format.
if Args.GridCol = 3 then
begin
//We cant modify directly Args.CellFormats.Property.
//So we use a temp variable.
Fmt := Args.CellFormat;
Fmt.Format := '00.00';
Args.CellFormat := Fmt;
end;
end;