I think the problem comes from my thousand separator on the grid
My display format is # ### ##0.00
There are spaces, so it’s logical the cell in the excel result file is a string
I tried these code:
procedure TFmultiCS_CF_R.AdvGridExcelExport1ExportCell(Sender: TObject;
var Args: TExportCellEventArgs);
var
Fm: TFlxFormat;
begin
if Args.GridCol = 6 then
begin
Fm := Args.CellFormat;
Fm.Format := '# ### ##0.00';
Args.CellFormat := Fm;
end;
end;
It worked once ! But I should have modified something else and it doesn’t work any more !
Hi,
Formatting can be complex because the grid stores the floats as strings, and indeed, it might happen that we can't convert them back to a float if for example there is a space.
This being said, I am not sure I can reproduce this case. I attach a simple app, it works as expected. Do you think you can change it so it shows what you are seeing?
As you can see, the number is a not a string (1), but it is formatted correctly (2) and the format is '# ### ##0.00'; (3). Of course, this only happens in column 6, since that's the column we are setting the format.
The code I used is below, as said, if you can find any property that is different in your case, that might help us find what is going on. advexp.zip (12.4 KB)