Export FlexGrid Data to CSV

Posted by: devansh.patel on 18 April 2024, 10:40 pm EST

  • Posted 18 April 2024, 10:40 pm EST

    The requirement is to exporting a flex grid data into csv format. Also another requirement in addition to that is one of the column has date as string field in it and the requirement is to change the format of the date before exporting. Can you suggest some best ways to do it? Any help is highly appreciated…

  • Posted 23 April 2024, 4:02 am EST

    Hello Devansh,

    Please refer to the following documentation for exporting the FlexGrid content as the CSV format.

    https://developer.mescius.com/wijmo/docs/Topics/Grid/ImportExport/Export-To-Excel-CSV

    As you would like to change the Date Format of the column before exporting.

    For this, there are two ways:

    1. Change the Column date format before exporting as:

      grid.columns[2].format = “yyyy-MM-dd”

    And then export to the CSV. And after export, you may reset the format to the original format. But it might cause a flicker for the date column due to format change.

    1. Use a hidden FlexGrid with the same collectionView that would be used to visible FlexGrid. But this hidden FlexGrid would have the targeted column date format set from initial and on export this FlexGrid would be used.

    Hope it helps!

    Regards,

    Manish Gupta

Need extra support?

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

Learn More

Forum Channels