This is a migrated thread and some comments may be shown as answers.
Error when running saveAsExcel() : uncaught Error: JSZip not found.
2 Answers 137 Views
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 02 Nov 2016, 07:37 PM

 

 

I am trying to export data from my grid to Excel. 

For my button I am using the following code, as I don't have the buttons in a toolbar.

 

<span>
<button id="btnExport">Export to Excel</button>
<script> $("#btnExport").kendoButton({
click: function() { 
$("#grid").data("kendoGrid").saveAsExcel() 

})</script>
</span>

and on the grid I have the following (truncated)

// Grid
grid = $("#grid").kendoGrid( {
      excel:{
          fileName: "PC Inventory All.xlsx",
          filterable:true,
          allPages:false
        },

The error message that I receive is "uncaught Error: JSZip not found."

I have included this file, or at least I thought that I have. I am running Xpages (JSP in essence) and my theme includes the following resources:

 

 <resource>
 <content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jquery.min.js</href>
</resource>

 <resource>
 <content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jszip.min.js</href>
</resource>

<resource>
 <content-type>application/x-javascript</content-type>
 <href>/.ibmxspres/domino/KendoUI/js/kendo.all.min.js</href>
</resource>

 <resource>
 <content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.common.min.css</href>
</resource>

 <resource>
 <content-type>text/css</content-type>
 <href>/.ibmxspres/domino/KendoUI/styles/kendo.blueopal.min.css</href>
</resource>

I see all of these resources in the Sources tab of Chrome Dev tools, but I also see several multiple defines - one of which seems to be doing something with a dojo library. 

I am at a loss, any help would be much appreciated.

 

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Nov 2016, 12:11 PM
Hello Bryan,

This is not a known issue, but I found a similar one for loading JsZip with XPages, and I can suggest checking if the workaround will work in your scenario:

http://stackoverflow.com/questions/39949147/configuration-of-the-javascript-library-docxtemplater-in-xpages

Another option is to try to load the file in a regular script tag and check if it is correctly requested and loaded in the network tab.

Let me know if you need additional information on this matter.

Regards,
Stefan
Telerik by Progress
 
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
 
0
Tarek
Top achievements
Rank 1
answered on 31 Mar 2021, 05:07 AM
https://docs.telerik.com/kendo-ui/framework/excel/introduction?&_ga=2.68600145.1324676021.1617127822-1120035905.1597754983&_gac=1.125769080.1616528173.Cj0KCQjwo-aCBhC-ARIsAAkNQisOY_fmQbxH7LMHXApXspip5DSSRS9eItBVOduUFN0Hb_QtXXZ7apAaAuPzEALw_wcB#using-requirejs
Tags
Grid
Asked by
Bryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Tarek
Top achievements
Rank 1
Share this question
or