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
1
vote
1 answer

How to remove Undefined values in JAVASCRIPT from excel values (when it's blank, use blank rather than undefined)?

I found this code that works fine but when there is a blank value in excel, it shows undefined, while i would like it to remain blank. Any help would be great, however I just started programming a few days ago, so details on the syntax would be…
l4cky
  • 43
  • 5
1
vote
1 answer

Displaying values of an object.name in a sheetJS excel sheet

I am creating a sheetJS xlsx sheet in my Angular app from an array of models. Each model structure is as below, { id: number, category: { id: number, name: string, }, name: string } I want the sheet to show the data as follows, id | …
Danny Jebb
  • 802
  • 1
  • 7
  • 16
1
vote
1 answer

How to change the type of columns of excel files for exported SheetJS xlsx?

I want to convert a table into an xlsx file. I'm using SheetJS. It success to get data, create the file and download it. The issue comes from excel types. For excel, all columns are simple string, and for example 23,0€ isn't recognize as money, and…
Elikill58
  • 4,050
  • 24
  • 23
  • 45
1
vote
0 answers

In SheetsJS, is there a way I can export and import data in the internal SheetsJS format?

from what I understand, SheetsJS uses an internal data structure, called the SheetJS data model, to internally manage spreadsheets and make them interoperable. I really like how well documented the format is, and how easy it seems to be able to…
greenbas
  • 11
  • 1
1
vote
0 answers

How to specify different dateNF for different columns while exporting xlsx from json

I have following data - {billDate: "21-1-2021", createdDate: "20-2-2021", modifiedDate: "20-2-2022"} ... ] I have converted date string to date js objects. While exporting to sheet using method XLSX.utils.json_to_sheet How can i specify different…
Sumit M
  • 620
  • 5
  • 12
1
vote
0 answers

How to add report title before header row in SheetJs in angular

I'm trying to export JSON to excel by using SheetJS, but I'm not able to add the title to the table. Now, I want to add a title in the middle of a row before the header row. In export service : import { Injectable } from '@angular/core'; import *…
Raveen
  • 13
  • 3
1
vote
1 answer

How to get a worksheet’s name in SheetJS?

I want to get the name of an existing worksheet. Worksheet objects don’t seem to have a property for that. I can get worksheet names from a Workbook’s Sheets property, but when handling a single worksheet, I don’t have access to its hosting…
1
vote
2 answers

Could someone guide me on the specific code or steps required to add border colors to cells using the SheetJS library?

I'm currently working with the SheetJS library to manipulate an existing Excel sheet, and I need assistance with adding border colors to specific cells. I've already explored the documentation and examples provided by SheetJS, but I couldn't find a…
manimk
  • 19
  • 6
1
vote
1 answer

SheetJS specify header order with json_to_sheet

I am using SheetJS in angular to export json as .xlsx file. For reference the json could be as follows: [{ "ID": "E111", "Name": "John", "LastLogin": "2022-02-12" }, { "ID": "E112", "Name": "Jake", "Score": 22 "LastLogin":…
1
vote
0 answers

How in SheetJS to wrap the text in every cell to be multiline excluding the header

I'm trying to understand how to wrap text in SheetJS to be able to have long texts in a cell split in multiline. So far whatever I tried didn't work const generateMasterReport = data => { // Workbook const wb = XLSX.utils.book_new(); //…
Jakub
  • 2,367
  • 6
  • 31
  • 82
1
vote
0 answers

SheetJS - TypeError: Cannot read properties of undefined (reading 'writeFile') while calling writeFileAsync method of sheetjs in react js application

I am facing an error in react js application TypeError: Cannot read properties of undefined (reading 'writeFile') while calling writeFileAsync() method of sheetjs in react js application while calling method writeFileAsync. I have passed filename…
atulk
  • 11
  • 3
1
vote
0 answers

How can I change the order of dates in my table column?

Each row goes into the array correctly. There are dates between A13-A28 in my spreadsheet, but it may not always be between A13 and A28. Can I sort them as I want? I extracted the regex if there is only the date line in the column. Is there a more…
oykn
  • 190
  • 1
  • 12
1
vote
2 answers

Excel/XLSX library SheetJS is undefined after import

I am trying to create and export an Excel spreadsheet. This is my code: import XLSX from 'xlsx'; const downloadExcel = () => { console.log(XLSX); const worksheet = XLSX.utils.json_to_sheet(excelExport); const workbook =…
saeed
  • 69
  • 1
  • 9
1
vote
1 answer

How to block certain cells in sheetJS Excel using protect

How can we lock certain cells in excel by using SheetJs ws['!protect'] There is a Worksheet Protection Details section which has some keys but there usage is not clear from the…
gaurav rathor
  • 187
  • 1
  • 2
  • 9
1
vote
0 answers

Read multiple Excel files with React SheetJs

I have an issue reading multiple excel files even when i put the "multiple" HTML tag. This is the handleFile function : handleFile(file /*:File*/) { /* Boilerplate to set up FileReader */ const reader = new FileReader() const rABS =…