FMXGridCellIO issues

I'm trying to export my FMXGrid to Excel by using the TTMSFMXGridCellIO component.

Most of it seems to work OK, but there are some issues

  1. The Option ExportHiddenColumns doesn't seem to work
  2. The first column and row are not exported
    Even when I set the properties XlsStartCol and XlsStartRow to 0
  3. The grid event GetCellData is not used during export, so the values on the screen and in the XLS may be different 

Hi,


1) Can you provide us with sample code that is able to reproduce this?
2) The XlsStartCol and XlsStartRow are the properties/parameters that define where the starting cell is in the Excel file. You need to use the GridStartRow and GridStartCol properties instead.
3) Set TMSFMXGrid1.Options.IO.SaveVirtualCellData := True;

Hi Pieter,


GridStartCol and GridStartRow work fine
(I didn't read the documentation good enough)

Here's my example about not exporting the hidden columns.
I just dropped a TTMSFMXGrid and TTMSFMXGridExcelIO on the form.

procedure TForm1.FormCreate(Sender: TObject);
var
  c, r: Integer;
begin
  TMSFMXGrid1.RowCount     := 10;
  TMSFMXGrid1.ColumnCount  := 10;
  TMSFMXGrid1.FixedColumns := 0;

  for r := 0 to TMSFMXGrid1.RowCount - 1 do
  begin
    for c := 0 to TMSFMXGrid1.ColumnCount - 1 do
    begin
      TMSFMXGrid1.Cells[c, r] := Format('R%dC%d', [r, c]);
      TMSFMXGrid1.Comments[c, r] := Format('Comment R%dC%d', [r, c]);
    end;
  end;

  TMSFMXGrid1.HideColumn(8);
  TMSFMXGrid1.HideColumn(6);
  TMSFMXGrid1.HideColumn(4);
  TMSFMXGrid1.HideColumn(2);

  TMSFMXGridExcelIO1.GridStartRow := 0;
  TMSFMXGridExcelIO1.GridStartCol := 0;
  TMSFMXGridExcelIO1.Grid         := TMSFMXGrid1;

  TMSFMXGridExcelIO1.Options.ExportHiddenColumns := True;
  TMSFMXGridExcelIO1.XLSExport('c:\temp\test.xls');
end;

Unfortunately after further investigation this feature was excluded from the VCL to FMX conversion but the ExportHiddenColumns property remained exposed. We will investigate here if we can add support for exporting hidden columns & rows for the FireMonkey version of the grid.