RxDBGrid export to .xls/xlsx lazarus / 21-General ---------------------------------------------------------------------- flori · 2021-02-19 16:37 Hi everyone! i have a little demo which can export rxdbgrid contents to .xls file. The dbgrid cells has background yellow that write 'dust' When I export dbgrid conent after I don't see it cells color on xls. (i only see it in dbrgird orange cells) does anyone know why this is? I set RxDBGridExportSpreadSheet : export color =true export button:  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  if SaveDialog1.Execute then    begin     RxDBGridExportSpreadSheet1.FileName:=SaveDialog1.FileName;     RxDBGridExportSpreadSheet1.Execute;    end; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.RxDBGrid1PrepareCanvas(sender: TObject; DataCol: Integer;  Column: TColumn; AState: TGridDrawState);   begin  if Column.FieldName='TYPE' thenbeginif Column.Field.AsString='dust' thenbeginwith (Sender As TRxDBGrid) dobegin   Canvas.Brush.Color:=clYellow;  Canvas.Font.Color:=clRed;  Canvas.Font.Style:=[fsBold];end;end;end;end; ---------------------------------------------------------------------- flori · 2021-02-19 19:29 'dust'  red color cell is not show in excel Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.RxDBGrid1PrepareCanvas(sender: TObject; DataCol: Integer;  Column: TColumn; AState: TGridDrawState);begin   if (Sender as TRxDBGrid).Datasource.Dataset.Fields[1].AsString='dust' then  begin  (Sender as TRxDBGrid).Canvas.Font.Style:=[fsBold];    (Sender as TRxDBGrid).Canvas.Brush.Color:=clred;  end;end; ---------------------------------------------------------------------- lfyey121 · 2025-04-12 10:41 When RxDbGridExportSpreadSheet export excel, if the field type is FMTBCD, then export the column is a text format rather than numerical format. If ftfmtbcd is added to NumericDataTypes in rxdbutils unit, it can be exported to numeric format:   NumericDataTypes = IntegerDataTypes + [ftFloat, ftCurrency, ftBCD, ftfmtBCD];