New to Kendo UI for jQuery? Start a free 30-day trial
Exporting Excel File to ZIP Using Kendo UI for jQuery
Updated on Nov 20, 2026
Environment
| Product | Kendo UI for jQuery |
| Version | 2026.3.1015 |
Description
I want to export one or more Excel files created using the built-in Kendo UI API into a ZIP file. This process requires combining Kendo UI's Excel export functionality with an external library like JSZip.
This knowledge base article also answers the following questions:
- How can I zip exported Excel files in Kendo UI for jQuery?
- How to use JSZip to zip files with Kendo UI for jQuery Excel export?
- Can Kendo UI for jQuery export data as a ZIP file?
Solution
To export an Excel file to a ZIP archive, follow these steps:
-
Include the necessary libraries in your HTML file:
- jQuery
- Kendo UI
- JSZip (external library for ZIP file creation)
-
Define the Excel file structure using Kendo's OOXML Workbook format.
-
Convert the Kendo Workbook to a Base64 Data URL asynchronously.
-
Use JSZip to create a ZIP archive and add the Excel file to it.
-
Generate the ZIP file as a binary blob and download it using Kendo's
kendo.saveAsmethod.
Below is an example implementation:
<script src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
<button id="exportBtn" style="padding: 10px 20px; font-weight: bold; cursor: pointer;">
Generate ZIP with Excel File
</button>
<script>
$(document).ready(function () {
$("#exportBtn").on("click", function () {
// 1. Define your Excel structure using the Kendo OOXML Workbook format
var workbook = new kendo.ooxml.Workbook({
sheets: [
{
name: "Invoices",
columns: [
{ width: 100 },
{ width: 150 },
{ width: 100 }
],
rows: [
// Header Row
{
cells: [
{ value: "Invoice ID", bold: true, background: "#4CAF50", color: "#ffffff" },
{ value: "Customer Name", bold: true, background: "#4CAF50", color: "#ffffff" },
{ value: "Amount", bold: true, background: "#4CAF50", color: "#ffffff" }
]
},
// Data Row 1
{
cells: [
{ value: 1001 },
{ value: "Acme Corp" },
{ value: 1250.50, format: "$#,##0.00" }
]
},
// Data Row 2
{
cells: [
{ value: 1002 },
{ value: "Globex Corporation" },
{ value: 3400.00, format: "$#,##0.00" }
]
}
]
}
]
});
// 2. Convert the Kendo Workbook to a Base64 Data URL asynchronously
workbook.toDataURLAsync().then(function (dataUrl) {
// Extract just the raw Base64 string from the data URI
var base64Data = dataUrl.split(";base64,")[1];
// 3. Initialize JSZip and add the Excel file into it
var zip = new JSZip();
// file() accepts base64 data if you pass {base64: true}
zip.file("Financial_Report.xlsx", base64Data, { base64: true });
// 4. Generate the ZIP file as a binary blob and download it via Kendo's saver
zip.generateAsync({ type: "blob" }).then(function (content) {
// Use Kendo UI's built-in file saver to trigger the browser download
kendo.saveAs({
dataURI: content,
fileName: "Exported_Data.zip"
});
});
});
});
});
</script>