C1FlexGrid save to Excel file

Posted by: alex.corti on 30 May 2022, 9:39 am EST

    • Post Options:
    • Link

    Posted 30 May 2022, 9:39 am EST

    Hi,

    now I’m using this command to save my Grid to XLS file.

    _fgTable.SaveExcel(saveFileDialog.FileName, FileFlags.IncludeFixedCells);

    Its’ working but my customer ask me a new feature.

    He wants to save only a subset of selected columns (for example 5 of 10, 3 of 11, and so on)

    My question is very simple: does it exist a method that allow to export some specific cols?

    Or I have to create a new datasurce with less cols and so I have to apply the same command for exporting the subset?

    Thanks Alex

  • Posted 31 May 2022, 1:50 am EST

    Hi Alex,

    There is no such export method in the C1FlexGrid that exports only the specific Columns of the Grid. To export the Grid with only specific columns, what you can do is set the Visible property of the Columns not to be exported to false and then Export the Grid using the FileFlags.VisibleOnly parameter of the SaveExcel method. Kindly refer to the attached sample showing the same.

    ExportSpecificCols_FG.zip

    Best Regards,

    Kartik

  • Posted 31 May 2022, 3:09 am EST

    Hi Kartik,

    thanks for your solution.

    With your tip I will write less rows of code.

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels