Excel file is corrupted when it is created with the kendo.ooxml.Workbook toDataURL method, using stringified sheet data:
let dataURL = new kendo.ooxml.Workbook(JSON.stringify(data)).toDataURL();
If the data is passed to the Workbook without stringifying it, this causes a circular reference error (check the console).
let dataURL = new kendo.ooxml.Workbook(data).toDataURL();
Dojo example.
The generated Excel file is corrupted
The generated Excel file is not corrupted
Hi,
As marked in the related GitHub issue:
This is not a bug in the Workbook initialization functionality. It is an improper way of initializing the class. The proper way to do so would be:
let dataURL = new kendo.ooxml.Workbook(JSON.parse(JSON.stringify(data))).toDataURL();
Note that the Workbook init would expect a JS object and not a string.
Here is a fully working Dojo sample:
- https://dojo.telerik.com/oQAWIgUS/4
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.