Table of Contents

TTMSFNCGridExcelExport.OnExportCell Event

Occurs before exporting every cell, and allows you to customize what is written in it.

Syntax

Unit: VCL.TMSFNCGridExcelExport / FMX.TMSFNCGridExcelExport

property TTMSFNCGridExcelExport.OnExportCell: TExportCellEvent

Examples

To modify the numeric format in column 3, you can use the code:

procedure TExampleForm.TMSFNCGridExcelExport1ExportCell(Sender: TObject;
  var Args: TExportCellEventArgs);
var
  Fm: TFlxFormat;
begin
  //Format cells in column 3 with a specific format.
  if Args.GridCol = 3 then
  begin
   //We can't modify Args.CellFormat.Property directly, so we assign it to a variable.
   Fm := Args.CellFormat;
   Fm.Format := '00.00';
   Args.CellFormat := Fm;
  end;

end;

See also