Export to XLSX

The JSS render is a premium extension to export the data from a JSS spreadsheet to an XLSX file.

Settings

PropertyDescription
filename: string File name. Default: jspreadsheet.xlsx


Author

Jspreadsheet Pro Team.

License

Available on the premium or enterprise plan.

Installation

Please choose one of the following options


Using CDN
Using NPM
<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<script src="https://cdn.jsdelivr.net/npm/jszip@3.6.0/dist/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/render/dist/index.min.js"></script>

<div id='spreadsheet'></div>

<input type="button" value="Download" onclick="download()"/>

<script>
const download = function() {
    jspreadsheet.render(document.getElementById('spreadsheet'), {
        filename: 'file.xlsx',
    });
}

// License for Formula Plugin
jspreadsheet.setLicense('ZmI0MTAxNTBhZmFlMWY0MGFlYjczZWJmY2Q4MDhmZTBhODc5ZmRkYjQ5MTE0ZjZhODVjNDJlMzdkNWUzYzNjMGVhMGEzNDEwOWRkMWM2MjYwYjY1NjJiMjA5ZDYzMDNmM2IyNTA5ODM5Y2MwZmJkYTc0YjEzODdlYjc2ZDBkM2MsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTJNREk0TmpFeE15d2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');

// Add-on for Jspreasheet
jspreadsheet.setExtensions({ render });

// Create the spreadsheets
jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [
        { minDimensions: [10, 10] },
        { minDimensions: [10, 10] },
    ],
});
</script>
</html>
// Working example: https://codesandbox.io/s/online-spreadsheet-with-react-and-jss-us1cm

// Jspreadsheet Pro
import jspreadsheet from 'jspreadsheet';

// Importer JSS Render
import render from '@jspreadsheet/render';

// Add a valid license
jspreadsheet.setLicense('ZmI0MTAxNTBhZmFlMWY0MGFlYjczZWJmY2Q4MDhmZTBhODc5ZmRkYjQ5MTE0ZjZhODVjNDJlMzdkNWUzYzNjMGVhMGEzNDEwOWRkMWM2MjYwYjY1NjJiMjA5ZDYzMDNmM2IyNTA5ODM5Y2MwZmJkYTc0YjEzODdlYjc2ZDBkM2MsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTJNREk0TmpFeE15d2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');

// Start the JSS plugin
jspreadsheet.setExtensions({ render });

// Create a spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [
        { minDimensions: [10, 10] },
        { minDimensions: [10, 10] },
    ]
});

// Call this method to create a XLSX file
let download = function() {
    // The method should receive the spreadsheet DOM element
    jspreadsheet.render(document.getElementById('spreadsheet'), {
        filename: 'file.xlsx',
    });
}


Examples


Integration with React

React spreadsheet working example.

Basic example

Click on the download button below to export the following JSS spreadsheet to XLSX.