Error when running saveAsExcel() : uncaught Error: JSZip not found.

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    13 posts
    Member since:
    Feb 2016

    Posted 02 Nov Link to this post

     

     

    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. Stefan
    Admin
    Stefan avatar
    276 posts

    Posted 04 Nov Link to this post

    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.
     
  3. Kendo UI is VS 2017 Ready
Back to Top