Posted 27 November 2020, 1:12 am EST - Updated 3 October 2022, 12:39 am EST
Hello,
I’ve tried just about everything.
I am trying to export my workbook to excel using excel IO and I keep getting an “Incorrect file format.” error. I am in development and do not posses a license yet.
The application is in Angular 11 and using the following packages.
“@grapecity/spread-excelio”: “^13.2.3”
“@grapecity/spread-sheets”: “^13.2.3”
“@grapecity/spread-sheets-angular”: “^13.2.3”
Here is the code I use to export the workbook.
I’ve also included screenshots of the function being called in debug.
public exportExcelFile(workbook: GC.Spread.Sheets.Workbook, filename: string): void {
const workbookJson = workbook.toJSON();
const stringifiedWorkbookJson = JSON.stringify(workbookJson);
const instance = new Excel.IO();
instance.save(stringifiedWorkbookJson, (blob) => {
console.log('Success');
}, (e) => {
if (e.errorCode === 1) {
console.log(e.errorMessage);
}
});
}
Thanks.