Hi,
currently currency field is not directly supported and it is handled as numeric field.
But you can set format by custom code in AfterExport event:
procedure TExportComps.XLSExpAfterExport(Sender: TObject);
var i, idx: integer;
begin
idx:=0;
for I := 0 to grEmp.Columns.Count - 1 do
begin
if SameText(grEmp.Columns[i].FieldName, 'Salary') then
idx:=i;
end;
XLSExp.FormatCells(XLSExp.ExportedDataRange.Row, XLSExp.ExportedDataRange.Column+idx,
XLSExp.ExportedDataRange.Rows.count, 1, '$ 0,00');
end;
I hope it helps
Tomas
Dne čtvrtek 5. prosince 2024 v 12:25:30 UTC+1 uživatel Lodovico Saccol napsal: