The sample demonstrates how to export or import FlexGrid content to/from an Excel(.xlsx) file with the save/load methods of the FlexGridXlsxConverter class.
Note: Sychronous methods work with JSZip 2.
To export FlexGrid content, pass the FlexGrid instance to the FlexGridXlsxConverter.save 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.load 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 load function, implemented in the FlexGridXlsxConverter class, takes the 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 save 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: