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

277 questions
6
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
  • 8,129
  • 15
  • 67
  • 111
6
votes
3 answers

sheet js xlsx writeFile callback

I am trying to write multiple csv files from a set of data that I have loaded using the sheet js library. My first attempt was like: for (let i = 0; i < dataSetDivided.length; i++) { let exportSet = dataSetDivided[i] …
Jimme
  • 201
  • 2
  • 3
  • 7
6
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
  • 255
  • 1
  • 2
  • 13
6
votes
4 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
  • 1,301
  • 8
  • 20
  • 33
6
votes
1 answer

Can not find module 'xlsx' in angular

I want to import xlsx. So, i install xlsx using npm install xlsx. And import xlsx module. import * as XLSX from 'xlsx'; (Also I try import { foo, bar } from 'xlsx';) And run this code with Angular cli. ng serve. I use it. Angular CLI: 1.6.1 Node:…
Jong-Hyen Kim
  • 765
  • 2
  • 6
  • 18
5
votes
1 answer

Exceljs vs SheetJs

I'm working with xlsx file. I've foudn 2 great libraries for it ExcelJS Sheetjs (Community Edition / ProEdition) But I'm not able to decide between them. Which obne should I choose ? I've looked into the comparision of their features but haven't…
Shadab Faiz
  • 2,380
  • 1
  • 18
  • 28
5
votes
1 answer

Save dynamically created table content in excel file using SheetJS

I add rows into html table dynamically and I want to save the table content into xlsx file using SheetJs. The generated file is empty. Is somehow possible to do this in this case when table content was added this way? I also tried to add the rows…
Cameron121341
  • 260
  • 1
  • 9
5
votes
2 answers

JS Library to create formatted XLSX spreadsheets

I'm currently creating generic spreadsheets in JS using https://www.npmjs.com/package/xlsx . This works fine to generate just a generic spreadsheet to display my data. However, I wanna add a few features. https://i.stack.imgur.com/3qBc7.jpg is an…
user2402616
  • 1,434
  • 4
  • 22
  • 38
5
votes
1 answer

Export HTML table to excel with formatting

I am creating a web page where the data is uploaded to an HTML table. After some calculation, a output HTML table gets generated.The output HTML table must be dumped in Excel (.xlsx) format. I'm using SheetJS library for uploading and downloading…
BBRK
  • 102
  • 1
  • 1
  • 12
5
votes
1 answer

Export array of JSON objects to Excel using SheetJS

I have an array of JSON objects, like this: [ {"name":"John", "city": "Seattle"}, {"name":"Mike", "city": "Los Angeles"}, {"name":"Zach", "city": "New York"} ] when I use the code below, it's not working: _export: function(records,opts)…
Mavericks
  • 283
  • 1
  • 7
  • 20
4
votes
3 answers

How to append new row to existing sheet in xlsm workbook in SheetJS

I am trying to append new rows into an existing Excel sheet but no luck. When I use writeFile instead of write function, then it creates a whole new file with all the data, but I want to append the rows to the existing records. This is the code till…
4
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":…
Mitul Panchal
  • 143
  • 2
  • 13
4
votes
1 answer

SheetJS js-xlsx - SheetJS is auto formatting my column with percentage value

I have the following HTML tables and Javascript function, using SheetJS to parse the tables then export them to an excel file. var tablesToExcel = (function() { return function(tables, wsnames, wbname) { var workbook =…
Donato Amasa
  • 846
  • 2
  • 6
  • 22
4
votes
0 answers

Error: End of data reached (data length = 110449, asked index = 171816). Corrupted zip ? ( node js , sheet js )

let file = [ { fieldname: 'retailers', originalname: 'PB,HR,CH.xlsx', encoding: '7bit', mimetype: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', buffer:
4
votes
2 answers

Achieving nested header structure while writing excel using SheetJS/ExcelJS

I want to achieve the below shown nested structure while writing the excel file in nodeJS application. I am not able to comprehend how to proceed. Is there a way to define multilevel headers or any JSON is possible using which I can achieve this…
1
2
3
18 19