Table of Contents

TAdvGridExcelExport.OnExportCell Event

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

Syntax

Unit: UAdvGridExcelExport

property TAdvGridExcelExport.OnExportCell: TExportCellEvent

Examples

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

procedure TExampleForm.AdvGridExcelExport1ExportCell(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