Import from XLSX

The JSS parser is a premium extension to create a JSS spreadsheet from an XLSX file.

Settings

PropertyDescription
url: string Load the XSLX from a remote URL. Bear in mind any potential CORS restrictions using this property.
locale: string Define the decimal and thousand separator based on a locale.
file: object load from a local file. This property is used along input type='file'
onload: function When the file is loaded.
onerror: function Method to be called when something is wrong.


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/parser/dist/index.min.js"></script>

<div id="spreadsheet"></div>

<input type="file" name="file" id='file' onchange="load(event)" style='display:none'>

<input type='button' value='Load a XLSX file from my local computer'
    onclick="document.getElementById('file').click()">

<script>
// Set license
jspreadsheet.setLicense('ZTQ3YWNmOGMzY2NmN2Y2YThjNGRmNzRkNjExZTljNGI5YWQwODFiYWE4NDY1NWM5ZTdmMjQyZjE3ZjQyZmU4YjIzNzVhM2Q5ZjZmYTcxNDg2MGYxNjUzZjlmNWQzNDE5MWYyNzk2MmRlNDAyNjA0NDk1YjYzNDc0NDFjMTVjMjYsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTJORFF5TWpjd055d2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');

// Set extensions
jspreadsheet.setExtensions({ parser });

// Create the spreadsheet from a local file
var load = function(e) {
    // Parse XLSX file and create a new spreadsheet
    jspreadsheet.parser({
        file: e.target.files[0],
        // It would be used to updated the formats only
        locale: 'it-IT',
        onload: function(config) {
            jspreadsheet(document.getElementById('spreadsheet'), config);
        },
        onerror: function(error) {
            alert(error);
        }
    });
}
</script>
</html>
// Jspreadsheet Pro
import jspreadsheet from 'jspreadsheet';

// Importer JSS Parser
import parser from '@jspreadsheet/parser';

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

// Set extensions
jspreadsheet.setExtensions({ parser });

// Create the spreadsheet from a local file
var load = function(e) {
    // Parse XLSX file and create a new spreadsheet
    jspreadsheet.parser({
        file: e.target.files[0],
        // It would be used to updated the formats only
        locale: 'it-IT',
        onload: function(config) {
            jspreadsheet(document.getElementById('spreadsheet'), config);
        },
        onerror: function(error) {
            alert(error);
        }
    });
}


Examples


Integration with React

Create a JSS spreadsheet from an Excel XLSX file.

Basic example

Click the Import button below to import an XLSX from your local device and create a JSS spreadsheet.