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
2
votes
0 answers

How to write to existing excel file using SheetJS in JavaScript

There is a form that a user will use to upload an excel file to. From there, in JavaScript, I am able to pull the data (this includes if excel file has multiple sheets) and store it in arrays (columnA, columnB, etc.). However, I am not sure how to…
Robert
  • 167
  • 1
  • 2
  • 14
2
votes
1 answer

Download excel file created in node using SheetJS/XLXS [NodeJS] [React]

I'm trying to generate a xlsx file using SheetJS in node. Then in my frontend I have a button to call this route and download the file. Currently I have the following: // backend code export function exportExcel(req: Request, res: Response) { try…
Fer-de-lance
  • 375
  • 5
  • 23
2
votes
1 answer

generating excel file with drop down menu menu while using of `xlsx-js-style` library

Im using of xlsx-js-style library for generating excel file, I can export my excel while type of columns are string or number. but I wanna to use of dropdown option as a one cell in excel. same as below screenshot. is there any way for doing?
2
votes
1 answer

sheetJS number format issues - European number format

I am trying to convert the float number to European formats. I tried to assign a format like below but it's not converting properly. works fine: cell.z = "#,###,##0.00"; does not work: cell.z = "#.###.##0,000" cell.z = "# ### ##0,000"; If it is…
Learner
  • 21
  • 2
2
votes
0 answers

Error: Corrupted zip : can't find end of central directory "When trying to read a slice of .xlsx file."- XLSX

I am trying to read the .xlsx file using FileReader and XLSX module. So If I am trying to read the whole .xlsx file then it's working fine. But I just want to read only the top 5 to 10 lines of .xlsx file. so that's why instead of passing an…
Aakash Giri
  • 53
  • 1
  • 8
2
votes
0 answers

How to head a CSV file using SheetJS keeping all values as strings

I need to implement a CSV parser. I choose SheetJS to do it. But when I parse a file to json, SheetJS converts iso date strings to a javascript Date and/or decimal numbers and also converts digits strings to numbers. For example, the value 045 will…
user3788133
  • 163
  • 2
  • 10
2
votes
1 answer

nextjs parse XLSX on API route from incoming request

I have been trying to reduce my NextJS bundle size by moving my XLSX parsing to an API route. It uses the npm xlsx (sheetjs) package, and extracts JSON from a selected XLSX. What I am doing in the frontend is let res; let formData = new…
Istvan Nagy
  • 113
  • 11
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
  • 393
  • 4
  • 22
2
votes
0 answers

add headers in columns in react native table using SheetJS js-xlsx

I have convertd and write the xlsx file of my table data. I have used react-native-table component library to create table and use SheetJS js-xlsx library for convert and write the file in xlsx format. I have write the file but i am unable to…
vjtechno
  • 452
  • 1
  • 6
  • 16
2
votes
0 answers

Decoding named ranges as Tables from excel files in JavaScript, React

I was working on a project which is dealing with excel manipulation and creating JSON(s) based on the data getting from excel. There is a number of named ranges in excel (Including named ranges as tables as well as by specifying the range). We are…
Abin Thaha
  • 4,493
  • 3
  • 13
  • 41
2
votes
1 answer

How to create a new sheet in an existing xlsx file using xlsx/sheetjs package in node js?

How to create/ add a new sheet file in an already existing xlsx file using the xlsx package by sheetjs in Node js? This is my code by far, for an existing "todo-list.xlsx" file. const xlsx = require('xlsx'); workBook =…
Ariadne R.
  • 452
  • 11
  • 24
2
votes
0 answers

Want to add missing cells using Sheet Js

I have this excel. Using Sheet JS library I want to add default values to the A column, now I have function which can add a cell function add_cell_to_sheet(worksheet, address, value) { /* cell object */ var cell = {t:'?', v:value}; …
2
votes
1 answer

React download data as xls with styles and components

I need to download some data as a csv but I need to highlight and custom some cells depending on cell value. I've found this example using "react-csv" but it seems to be using plain simple text and not components with styles. Same thing when Tried…
Yahav
  • 146
  • 11
2
votes
1 answer

Sheetjs - Sheet add Json ignores date format

I have a JSON that contains some data and I want to export it to Excel. Problem is that I can not achieve the correct date format when saved to Excel. The date format that I want to achieve is something like that 2020-07-30 07:31:45 I followed the…
Stamatis Tiniakos
  • 698
  • 1
  • 11
  • 33
2
votes
1 answer

How can I save the result in a variable correctly? XLSX Angular

I'm tring to read an excel file from an input with Angular and transform that file's data in an array of objects. My components are like this: import * as XLSX from 'xlsx'; import { Injectable } from '@angular/core'; @Injectable({ providedIn:'root'…