We are currently migrating our project from TTMSFNCGrid to the newer TTMSFNCDataGrid.
In our previous implementation using TTMSFNCGrid combined with TTMSFNCGridExcelIO, we were able to export grouped grids successfully. The exported Excel files correctly respected the state of the grid, meaning collapsed groups remained collapsed (only visible rows were exported/visible in the generated file).
However, after switching to TTMSFNCDataGrid and using TTMSFNCDataGridExcelIO, we noticed a different behavior:
Regardless of whether the groups are collapsed or expanded in the active TTMSFNCDataGrid, the generated Excel file always has all groups fully expanded.
The export process does not seem to respect the current collapsed/expanded state of the grid groups.
Is there a specific property or a workaround we can use in TTMSFNCDataGridExcelIO (or during the export process) to make sure the exported file matches the visual state (collapsed/expanded) of the grid?
If the collapsed state was set manually through RowNodeState, also hide the child rows before export:
for r := 0 to Grid.RowCount - 1 do
if Grid.IsRowNode(r) and (Grid.RowNodeState[r] = grnsCollapsed) then
for i := r + 1 to r + Grid.RowNodeChildCount[r] do
Grid.HiddenRows[i] := True;
Then export with ExportCellSizes = True. This should make those rows invisible in Excel, although the rows may still exist in the file with height 0.
For a true “export only what is visually shown” result, the safer workaround is to export from a temporary TTMSFNCDataGrid (or TTMSFNCDataGridRenderer) containing only the currently visible rows, then call TTMSFNCDataGridExcelIO.XLSExport on that temporary grid.
So: no dedicated property at the moment; use ExportCellSizes plus temporary hiding, or build a visible-rows-only temporary grid for an exact visual export.