v5.20191.606
|

wijmo.xlsx Module

The module has a dependency on the JSZip library which can be referenced as follows:

  • In order to invoke the synchronous save and load methods, JSZip2 library should be referenced in html page with the markup like this:
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
  • In order to invoke the asynchronous save and load methods, JSZip3 library should be referenced in html page with the markup like this:
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
  • If application is constructed based on npm modules then you may prefer to load JSZip module by means of the ES6 import statement, instead of a script tag. In this case you should additionally provide wijmo.xlsx module with a reference to the JSZip module using the useJSZip function, with a code like shown below:
    import * as JSZip from 'jszip';
    import * as wjcXlsx from 'wijmo/wijmo.xlsx';
    wjcXlsx.useJSZip(JSZip);
    

It's enough to call the useJSZip function only once per application page, and the best place to do it could be a some root module of the application.

Functions

useJSZip

  • useJSZip(jszip: any): void
  • NOTE: This function is OBSOLETE and retained for compatibility. It is no longer needed because wijmo.xlsx module loads jszip module automatically. You should only ensure that jszip module is installed in your application.

    Defines a reference to JSZip module that will be used by the Wijmo xlsx export modules.

    This method should be used in npm modules based applications to provide wijmo.xlsx module with a reference to the JSZip module retrieved using the ES6 import statement. For example:

    import * as JSZip from 'jszip';
    import * as wjcXlsx from 'wijmo/wijmo.xlsx';
    wjcXlsx.useJSZip(JSZip);
    

    Parameters

    • jszip: any

      Reference to the JSZip constructor function.

    Returns void