How to read in xlsx spreadsheet and convert it to csv string

Posted by: james.ingham on 1 July 2020, 10:03 pm EST

  • Posted 1 July 2020, 10:03 pm EST

    Dear support,

    We know Wijmo has FlexGridXlsxConverter class which can be used to export flexGrid data to xlsx spreadsheet. We are just wondering whether it’s possible to read in a spreadsheet and conver the first sheet to CSV using the same class (or other classes in the same module). At the moment we rely on js-xlsx library to do this job, but if Wijmo already has a built-in solution we may remove those 3rd party libraries and reduce our app’s bundle size.

  • Posted 2 July 2020, 5:26 pm EST

    Hi James,

    There is no direct way to convert excel to csv. You will need to create a FlexGrid and import the excel file and use the getClipString method to return a CSV string. You do not need to actually display the grid in order to save CSV. Please refer to the sample link below:

    https://stackblitz.com/edit/angular-k4myvv

    Regards,

    Ashwin

  • Posted 4 July 2020, 9:40 am EST

    Thanks Ashwin. Despite that we have to create a hidden grid, this would be workable solution.

Need extra support?

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

Learn More

Forum Channels