AdvGridExcelExport

Hello,

I have a problem with the AdvGridExcelExport component used with a DBAdvGrid.

I want to have the number as number in the excel result file , not string
In the DBAdvGrid , I set Formattype=ftexcel and floatformat=0.00

The CellasString is false in the export option

But in my result file: the integer number are number, but the decimal number are string ?

Thanks

hello,

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 !

I think I am near the solution..

regards

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)

Regards,
Adrian.

Sorry, in my last post I attached an older zip. I attach the correct one here:
advexp.zip (12.4 KB)