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
14
votes
1 answer

sheetjs xlsx, How to write merged cells?

I need to create a xlsx with merged cells using sheetjs. data: [ { "id": "nick", "items": [ { "name": "ball" }, { "name": "phone" } ] }, { "id": "jack", "items": [ { …
chacker
  • 185
  • 2
  • 7
11
votes
1 answer

SheetJS xlsx-cell styling

I am referring this example to export a worksheet https://github.com/SheetJS/js-xlsx/issues/817. How to do cell styling like background coloring,font size and increasing the width of the cells to make the data fit exactly.I have gone through the…
GrailsLearner
  • 317
  • 1
  • 6
  • 18
11
votes
2 answers

How to add cell border to SheetJS .xlsx generated file?

I have a SheetJS .xlsx generated file, but I have not been able to put border to the cells. I have this: And I need this: Is there a way to do it with SheetJS? It will be cool if there's a way to apply another cell styles, like background…
10
votes
1 answer

How to convert a nested json object into an excel table using the xlsx npm library?

I've got a nested json object. For the sake of simplicity: data = {'key1': 1, 'key2': 2, 'key3': {'nestedKey1': 3, 'nestedKey2': 4}} A real object is bigger but the point is that it's a nested one. Values may be strings, numbers or other…
GoBear
  • 298
  • 2
  • 16
9
votes
0 answers

Multiple tables in single sheet using sheetJS

I am successfully using the example from sheetJS's website, like so: /* create new workbook */ var workbook = XLSX.utils.book_new(); /* convert table 'table1' to worksheet named "Sheet1" */ var ws1 =…
AussieJoe
  • 1,133
  • 1
  • 9
  • 25
8
votes
4 answers

SheetJS json_to_sheet renaming headers

I have an array of objects. By default, sheet_to_json uses object keys as headers. However, I need to rename those headers without explicitly modifying my array of objects. Is this possible?
Kay Singian
  • 971
  • 4
  • 17
  • 29
8
votes
2 answers

How to write into a particular cell using xlsx npm package

I have to write a value to a particular cell (say the D4 cell) in my xlsm file. I can see the option of XLSX.writeFile(workbook, 'out.xlsx'); in the XLSX package documentation (writing functions) But I am not seeing anything to write a value to a…
Ashish
  • 121
  • 1
  • 2
  • 9
6
votes
3 answers

Format date with SheetJS

Thank you in advance for taking a look at this question! I am trying to use SheetJS to read a .xlsx file but am having some trouble with a column of dates that is formatted via Excel as Custom "yyyy/mm/dd hh:mm:ss". All of these dates show up as…
sivs
  • 253
  • 1
  • 2
  • 8
6
votes
1 answer

Export to excel with React and SheetJS

I am trying to implement export to excel with React and SheetJs library. Looks like I can download it, but the actual output does not look as expected. I receive array of object and use XLSX.utils.json_to_sheet([data]) API to converts an array of…
Palaniichuk Dmytro
  • 2,041
  • 3
  • 26
  • 53
5
votes
0 answers

How do I append XLSX data to existing worksheet using SheetJS?

I am currently using NodeJS and the library SheetsJS to read an XLSX workbook. My task is to take data from multiple sheets and append them to a new worksheet. The structure of the sheet has the Categories in Column A and Category Values in Column…
hello_there
  • 175
  • 3
  • 9
5
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
  • 131
  • 1
  • 2
  • 6
5
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
  • 525
  • 2
  • 4
  • 15
4
votes
0 answers

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
  • 92
  • 1
  • 9
4
votes
1 answer

SheetJs converting date automatically angular 7

I'm using sheetjs in angular 7. And I'm exporting excel from my json. But excel converting my date to 02/29/2019 format. But, I'm sending "29.02.2019". I'm sending as string, excel still converting. I also send "29.02.2019." by adding "." character…
realist
  • 1,599
  • 6
  • 25
  • 58
4
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
  • 253
  • 1
  • 6
  • 20
1
2 3
12 13