The sample demonstrates how to export or import FlexGrid content to/from an Excel(.xlsx) file asynchronously with the saveAsync/loadAsync methods of the FlexGridXlsxConverter class.
Note: Asychronous methods work with JSZip 3.
To export FlexGrid content, pass the FlexGrid instance to the FlexGridXlsxConverter.saveAsync method. This generates the Excel file content, which can be saved to a local file or sent to a server.
To populate FlexGrid with data from an Excel file, pass the FlexGrid instance and the Excel file content to the FlexGridXlsxConverter.loadAsync method.
In this sample, click the "Browse" button to select an .xlsx file, then click the "Import" button to load the file into the FlexGrid.
The loadAsync function, implemented in the FlexGridXlsxConverter class, takes content of an Excel file as input, parses it using the wijmo.xlsx.js library, and populates the specified FlexGrid instance with the parsed data.
The saveAsync function, implemented in the FlexGridXlsxConverter class,
takes a FlexGrid instance as input, converts its data and formatting
to Excel format using the wijmo.xlsx.js library.
If the file name is specified, it will save it to a file on the local disk.
Otherwise, it returns a Workbook instance containing the content for Excel file.
To add Excel import or export support to your application, follow these steps: