[]
        
(Showing Draft Content)

FlexSheet Import and Export Excel Files

You can import existing Excel files into FlexSheet or export FlexSheet to a new Excel file.

FlexSheet has load and save methods for each of these functions.

Import from Excel

import * as wjFlexSheet from '@mescius/wijmo.grid.sheet';

let excelIOSheet = new wjFlexSheet.FlexSheet('#excelIOSheet');

//Import a file from end user
let fileInput = document.querySelector('#importFile');
if (fileInput.files[0]) {
    excelIOSheet.loadAsync(fileInput.files[0]);
}

Export to Excel

//allow custom input for filename
let fileName = document.querySelector('#fileName').value;
if (fileName == null || fileName === '') {
    fileName = 'FlexSheet.xlsx';
}
//export FlexSheet to Excel
excelIOSheet.saveAsync(fileName);