Questions tagged [js-xlsx]

JavaScript Spreadsheet Parser and Writer

Parser and writer for various spreadsheet formats. Pure-JS cleanroom implementation from official specifications, related documents, and test files. Emphasis on parsing and writing robustness, cross-format feature compatibility with a unified JS representation, and ES3/ES5 browser compatibility back to IE6.

Resources

137 questions
27
votes
4 answers

Create an excel file with a few styles using client side JavaScript (if possible using js-xlsx library)

I want to create an excel file(in .xlsx format) and make it available for download using Client Side JavaScript. I was able to create a sample file using js-xlsx library. But I am not able to apply any styles to it. At least some basic styles…
Nithin Baby
  • 7,486
  • 4
  • 21
  • 25
17
votes
2 answers

sheetJS: How should the cell object look when you want to transform milliseconds to h:mm?

Does someone have an idea how the cell object should look like when you want to transform a value in milliseconds to a duration format of h:mm? At the moment I have a cell object which looks like { t: 'n', v: value, z: 'h:mm' } but it doesn't…
Logan_Dupont
  • 355
  • 3
  • 13
12
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
  • 161
  • 1
  • 2
  • 10
10
votes
1 answer

How to add filter in excel generated using js-xlsx plugin

I want to add filter on excel column which is created from array of data using js-xlsx javascript plugin but I didn't find any way to add filter to table column. Please help me if anyone knows how to add filter to columns in excel I have written…
Shree29
  • 634
  • 11
  • 29
8
votes
1 answer

Read and write a xlsm file using exceljs package npm

I have a xlsm file with few data already in it and need to write some data and create a new xlsm file during automation. With below code the file gets created , but it becomes corrupt and unable to open. File size reduces, for ex from 8kb to 7kb.…
Nalu
  • 195
  • 2
  • 13
7
votes
0 answers

Add worksheet to local workbook (js-xlsx)

(I used this page https://github.com/SheetJS/js-xlsx for my chrome extension.) I have a problem with adding a worksheet to a local workbook. I want to create a worksheet with data from a page, parse and save the data to a worksheet. This worksheet…
nise
  • 71
  • 1
  • 2
7
votes
3 answers

while using header option with XLSX.utils.json_to_sheet , headers not overriding

I'm trying to change header titles by passing an array of titles to options but it does not override the headers. Instead it inserts new headers before the original data. I am passing the same numbers of header titles. Here is my code: const ws:…
LearningPal
  • 554
  • 2
  • 12
  • 27
6
votes
0 answers

Error with xlsx-style when building angular 6 app

I installed xlsx-style in my angular 6 app via yarn and I get errors when I build my app : ERROR in ../node_modules/xlsx-style/dist/cpexcel.js Module not found: Error: Can't resolve './cptable' in…
Jordy
  • 165
  • 1
  • 3
  • 12
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
0 answers

How to download file from Web Worker?

In the project(that was writen on Angular4.3) we use xlsx to create xlsx/csv tables for download by user. The problem that we faced is when we try to export a big amount of data, original json file can be 100+Mb and converted xlsx/csv file can be…
Вадим
  • 125
  • 1
  • 6
5
votes
2 answers

Reading local Excel file with js-xlsx using Angular 13?

I have my Angular-CLI frontend development server running locally on localhost:4200 I need to get a local Excel file stored on my PC, read its content and make some calls to an API from the client side. I'm trying to use js-xlsx, got it installed…
Iñigo
  • 1,877
  • 7
  • 25
  • 55
4
votes
1 answer

XLSX Package vulnerabilities found but there is no newer package

I am using xlsx in my js code. It works fine from last year. Today I start getting problem and build fails. Dueto: $ yarn audit: yarn audit v1.22.19 ┌───────────────────────────────────────────────────────────────────────────── │ moderate:…
R.Almoued
  • 219
  • 6
  • 16
4
votes
1 answer

js-xlsx - get particular rows of excel sheet

I have an Excel sheet which has 500 rows. I am trying to get the rows from 101 to 200. I have searched in google, and I have found an example to get starting rows, e.g. 1 to 100 or 1 to 1000, or even 1 to any number. But I haven't found any code to…
Sai sri
  • 515
  • 12
  • 25
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
1
2 3
9 10