Telerik UI for ASP.NET MVC integrates the Pako and JSZip libraries to support the content export of its components to PDF and Excel.
The Pako Deflate library enables the compression of the files that will be exported to PDF. To enable the PDF export, you need to load Pako in the specified page.
<!-- Load Pako Deflate library to enable PDF compression --> <script src="http://kendo.cdn.telerik.com/2019.3.1023/js/pako_deflate.min.js"></script>
Since Excel files are a zipped collection of XML files, the JSZip library is necessary to process the generated workbook to an
Include the JSZip library:
- To support client-side Excel export (all components)
- To support Excel imports with the
fromFile()method (Spreadsheet component)
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.js"></script> <script src="http://kendo.cdn.telerik.com/2019.3.1023/js/kendo.all.min.js"></script>
JSZip is part of the Kendo UI distribution and is also available through the Kendo UI CDN.
- If you do not include JSZip in the page, Kendo UI will raise a runtime exception.
- As of the Kendo UI R3 2017 release, the Excel Export feature supports JSZip 2.x and 3.x versions. Kendo UI releases prior to R2 2017 SP1 provided Excel export of JSZip 2.x versions only.
When you use JSZip in scenarios where the packages are loaded from NPM, explicitly assign the JSZip object to a field in the
window object. To properly load JSZip in the application:
- Install the library and save it to the
package.jsonfile by running
npm install jszip --save.
- Import the library in the module where it will be used through
import JSZip from 'jszip'.
- Assign the library object to a field of the
window.JSZip = JSZip.
To use Globalizejs in your project, include it after the Kendo UI scripts.
Excel generation is available for all supported browsers. Saving a file needs a server-side proxy for older browser versions. For more information, refer to the article on saving files with Kendo UI for jQuery.
Some mobile browsers do not support the saving of files.