Questions tagged [sheetjs]

A pure JavaScript library to read, parse, edit, and write spreadsheets, or to convert them to different formats like JSON.

You can find more information at

184 questions
4
votes
2 answers

Angular - SheetJS - How to export HTML Table to Excel?

I copied the code from this "tutorial": https://sheetjs.com/demos/table.html function doit(type, fn, dl) { var elt = document.getElementById('data-table'); var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"}); return dl ? …
alansiqueira27
  • 6,707
  • 15
  • 52
  • 99
4
votes
2 answers

Accessing Cells with Sheetjs

I followed the demo here: https://github.com/SheetJS/js-xlsx/tree/master/demos/electron I'm able to drag an excel file into my electron app. The documentation says, you can access every cell with: for(var R = range.s.r; R <= range.e.r; ++R) { …
Piter Parker
  • 185
  • 1
  • 9
4
votes
1 answer

How to parse, and iterate through, all rows from an Excel sheet file using JavaScript

I am trying to parse and read every cell from an Excel sheet; it seems that I am parsing the file but I just can't go through each cell and display them. I am using the following code: var workbook = XLSX.read('datasets/persons.xlsx', { type:…
Mizlul
  • 1,802
  • 2
  • 27
  • 81
3
votes
1 answer

Add dynamic columns with xlsx/ sheetjs

I have an array of multiple tags with ids and data: [ { "id": "tagID1", "error": { "code": 0, "success": true }, "data": [ [1604395417575, 108, 3], [1604395421453, 879, 3] ] }, { "id": "tagID2", "error":…
3
votes
1 answer

How to set calculation mode of an xlsx file via Javascript?

I have a small code that imports an Excel workbook (xlsx) file, edits a cell value and finally saves the workbook in a different file. The problem with my code is that: in the new xlsx, auto-calculation is not set. I have to manually open the file…
Agricolo
  • 53
  • 8
3
votes
1 answer

SheetJS json_to_sheet is writing dates in ISO 8601 as strings

I'm using the SheetJS library to export data in my angular material datatable to excel. Everything is working fine except for the dates, which are not being formatted or detected as dates by excel. I have JSON data like this: { "id": 21658, …
Ernesto G
  • 465
  • 4
  • 14
3
votes
1 answer

XLSX.utils.book_new() is not a function error

I am using SheetJS library to convert Excel to JSON and vice versa. While the code to convert Excel to JSON works fine, there are issues with the code to convert JSON back to Excel. Please find the code below: var wb =…
Ashy Ashcsi
  • 1,045
  • 3
  • 16
  • 33
3
votes
1 answer

SheetJS library treats text as date incorrectly

There is a CSV file, which I try to read and it contains field with value "Aprobil P 0.1%" the short example of CSV: "Country";"Product Family" "Germany";"Aprobil P 0.1%" conversion to workbook is the following: var workbook = XLSX.read(csvData,…
Paul Z.
  • 133
  • 6
3
votes
0 answers

JQuery, FileSaver and SheetJS

I am trying to use SheetJS in order to push some js arrays to Excel. I looked at some tutorials and used the source code from SheetJS as an initial test. I have debugged and everything seems to work fine apart from the saveAs() method. Has anyone…
3
votes
1 answer

Node.js - get superscript and subscript in excel

I am parsing an excel which has superscripts and subscripts and want to enclose them like this : superscripted value subscripted value tried using xlsx, excel parser and SheetJS to try and identify if the value has been…
3
votes
1 answer

Get excel column headers using SheetJS

I am currently creating a web application that allows a user to upload an excel file into a database but before the user uploads the file I would like to allow them to check the headers of the excel file if it matches the preset on the database.…
3
votes
2 answers

How to freeze a pane in an Excel table using SheetJS?

I use SheetJS to make an Excel table in my node.js application: const xlsx = require('xlsx'); const workbook = xlsx.utils.book_new(); const worksheet = xlsx.utils.aoa_to_sheet([ ['Number', 'Name', 'Value'], [1, 'Bill', 1500], [2,…
Finesse
  • 6,684
  • 6
  • 44
  • 60
3
votes
3 answers

SheetJS how to format column

I have a Vue project that writes an excel file using SheetJS. How do I set the format of the columns in my generated excel file? I need to set the SalesOrderDate, CustomerRequestedDeliveryDate, ConfirmedDate, and _ProductionDate to date…
Kay Singian
  • 971
  • 4
  • 17
  • 29
3
votes
2 answers

Javascript Read Excel file on server with SheetJS

I am using a library called SheetJS and I want to read an excel sheet that resides on the server without using nodejs, only pure javascript. Is this possible? There is a message in the documentation that says "readFile is only available in server…
electricalbah
  • 1,897
  • 1
  • 18
  • 34
2
votes
2 answers

How to append (%) percentage sign without multiplying in XLSX JS

In XLSX, unable to append a cell value with % symbol. While trying, it's multiplying the cell value by 100. Input: ["Ball", 1000, 201.72]. Expected output in XLSX: ["Ball", 1000, 201.72%] Current output: ["Ball", 1000, 20172.00%] function test(){ …
SatishV
  • 323
  • 3
  • 16
1
2
3
12 13