Using KendoUI latest version, the exportToExcel function in Spreadsheet seems broken.
- Using version 2024.4.1112
- Dojo to reproduce: https://dojo.telerik.com/BMBegbqh (Dojo was linked in docs at https://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet/methods/saveasexcel)
Console shows error:
Daniel,
That version 2024.4.1112 no longer contains JSZip.js. In my program I am still using v 2023.3.1010
...and you can see the JSZip.js is part of the Kendo package or library. You need to find JSZip.js yourself unfortunately and place it in your project. I found it here: jszip/dist at main · Stuk/jszip · GitHub . I was testing version 2024.3.1015 as I routinely do to evaluate what it would take to update my project.... and it barfed while doing an import. There is some documentation on this in the Telerik site.
I used the minified version and plopped it in my project back where it used to be:
Also see: https://stuk.github.io/jszip for documentation.
I cannot guarantee it will work! But you have to get it and put it in your project. Your milage may vary. Also see:
Spreadsheet - a problem with fromFile function and JSZip library in Kendo UI for jQuery | Telerik Forums
Again finding the JSZip and putting it in manually worked for me....hopefully this might get you back on the road.
George, thanks for your response.
I verified JSzip 3.10 is already included in my project (using yarn package manager). I can instantiate a new JSZip instance in Chrome console. Removed the dependency, and now receive a "JSZip is not defined" error as expected, when trying to manually instantiate it.
However, the message when trying to execute the Spreadsheet export remains the same:
index-esm.js:23176 Uncaught TypeError: options.Workbook is not a constructor at next (index-esm.js:23176:1) at Workbook.saveAsExcel (index-esm.js:23170:1) at SpreadsheetWidget.saveAsExcel (index-esm.js:23741:1) at init.saveAsExcel (kendo.spreadsheet.js:5575:1) at exportExcel (<anonymous>:34:67)
Hi George,
Thank you for the input!
Nikolay