anchor.diff:    { TmAbstractGridHelper }
   
     TmAbstractGridHelper = class abstract
  +  strict private
  +    const DEFAULT_XLS_HEADER_COLOR : DWord = $00EED7BD;
     protected
       FGrid: TCustomGrid;
   
  
positive.code: 
  uses
    SysUtils, variants,
    mCSV, mFloatsManagement,
    mVirtualDatasetFormulasToXml, mGridColumnSettingsToXml, mSummaryToXml,
    mCellDecorationsToXml;
  
  
negative.code:   columns : TmGridColumns;
    curValue : Variant;
    d : double;
    helper : TmSpreadsheetHelper;
  begin
    fields := TmFields.Create;
    columns := TmGridColumns.Create;
    MyWorkbook := TsWorkbook.Create;
    try
      MyWorksheet := MyWorkbook.AddWorksheet('Sheet1');
      helper := TmSpreadsheetHelper.Create(MyWorksheet);
      try
        {$IFDEF WINDOWS}
        helper.DefaultFont.FontName:= 'Calibri';
        {$ELSE}
        helper.DefaultFont.FontName:= 'Arial';
        {$ENDIF}
        helper.DefaultFont.FontSize:= 10;
        helper.DefaultRowHeight:= 14;
  
        if FGrid.GetInterface(SImGridInterface, Intf) then
        begin
          Intf.GetFields(fields);
          Intf.GetColumns(columns);
  
          Intf.GetDataCursor.StartBrowsing;
          try
            col := 0;
            for i := 0 to columns.Count - 1 do
            begin
              if columns.Get(i).Visible then
              begin
                helper.WriteText(0, col, columns.Get(i).Title, false, true, DEFAULT_XLS_HEADER_COLOR);
                helper.WriteSouthBorder(0, col);
                inc (col);
              end;
            end;
  
            row := 1;
  
            Intf.GetDataCursor.First;
            while not Intf.GetDataCursor.EOF do
            begin
              col := 0;
  
              for i := 0 to columns.Count - 1 do
              begin
                if columns.Get(i).Visible then
                begin
                  curField := fields.FieldByName(columns.Get(i).FieldName);
                  curValue:= Intf.GetDataCursor.GetValueByFieldName(curField.FieldName);
                  if not VarIsNull(curValue) then
                  begin
                    if (curField.DataType = ftSmallint) or (curField.DataType = ftInteger) then
                      helper.WriteInteger(row, col, curValue)
                    else
                    if (curField.DataType = ftLargeint) then
                      helper.WriteInt64(row, col, curValue)
                    else
                    if (curField.DataType = ftFloat) then
                    begin
                      if curField.DisplayFormat <> '' then
                        helper.WriteFloat(row, col, curValue, curField.DisplayFormat)
                      else
                        helper.WriteFloat(row, col, curValue);
                    end
                    else
                    if (curField.DataType = ftDate) then
                    begin
                      d := curValue;
                      helper.WriteDate(row, col, round(d));
                    end
                    else
                    if (curField.DataType = ftDateTime) or (curField.DataType = ftTime) or (curField.DataType = ftTimeStamp) then
                    begin
                      d := curValue;
                      if DoublesAreEqual(0, abs(d - round(d))) then
                        helper.WriteDate(row, col, curValue)
                      else
                        helper.WriteDateTime(row, col, curValue);
                    end
                    else
                    if (curField.DataType = ftBoolean) then
                      helper.WriteBoolean(row, col, curValue)
                    else
                      helper.WriteText(row, col, VarToStr(curValue));
                  end;
                  inc(col);
                end;
              end;
  
              inc(row);
              Intf.GetDataCursor.Next;
            end;
          finally
            Intf.GetDataCursor.EndBrowsing;
          end;
        end;
      finally
        helper.Free;
      end;
      MyWorkbook.WriteToStream(aStream, sfExcel8);
    finally
  