Node package to read, manipulate and write spreadsheet data and styles to XLSX and JSON.
Questions tagged [exceljs]
508 questions
6
votes
2 answers
How to get cell by name with exceljs?
For now, I have to hardcode like this
var cell = worksheet.getCell('A1');
But I want to define my cell by name like data and access the cell by:
var cell = worksheet.getCell('data');
How can I do that with exceljs ?
Thank you very much!
Note:…

Tran B. V. Son
- 759
- 2
- 12
- 31
6
votes
2 answers
Changing font color while adding row in exceljs
As per the documentation, Changing font color of a particular cell is possible in this way:
sheet.addRow([
'alex',
{
text: 'image',
hyperlink: 'http://something.com' //trying to change color of this cell
…

Srujan Reddy
- 730
- 1
- 6
- 27
5
votes
0 answers
how to set background color in excel js, depending on the value?
How can I get the values of a column and paint the background color depending on the value.
I have the column: "Stock" and I need to know when the value is 0 to make the background red.
in this way I paint the first row of the header. Is it possible…

sergioac
- 63
- 2
- 5
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
0 answers
workbook.xlsx.writeBuffer() is working fine in Dev but not working in production
I am using ExcelJs Lib(1.12.0) inside angular 6 but this Lib is wokring fine in dev but not in production its failing at point workbook.xlsx.writeBuffer().
import * as ExcelJS from "exceljs/dist/exceljs.min.js";
downloadExcelFile() {
const title =…

Shubham Singh
- 147
- 1
- 2
- 15
5
votes
1 answer
ExcelJS Data under specific date column
I am creating an excel sheet using exceljs package in nodejs application. I have an array of headers that I've generated like this.
const monthsArray = arrDays.map((str) => (
{ header: str, key: str, width: 10 } // Example { header: "12-15-2021",…

Ehsan Nissar
- 643
- 2
- 13
- 35
5
votes
0 answers
How to Insert Image using ExcelJs into a cell
I'm trying to add an image to a specific cell, is there any way I can adjust the image size or the cell size so it can fit on the cell.?
result.map(order => {
const worksheet = workbook.addWorksheet(order.branch_code);
…

Thorin
- 131
- 1
- 2
- 9
5
votes
0 answers
How client(React) download excel file in NodeJS?
I have two separate projects. Client: React, Server: NodeJS
I create excel on the NodeJS side by submitting a form by React.
I want to download this excel from React side. However, I couldn't download it.
NodeJS code
res.setHeader('Content-Type',…

resobyte
- 116
- 7
5
votes
1 answer
ExcelJS: "Uncaught EvalError: 'unsafe-eval' is not an allowed source of script in the following Content" in Angular App
I have deployed Angular Application that uses ExcelJS library on IIS server. My current security policy forces me to return below header in IIS Http Response
content-security-policy: script-src 'self';img-src 'self'
With this setting, angular app is…

Pratik
- 51
- 1
- 3
5
votes
2 answers
Unable to write data (addRow) into Excel file in Nodejs
I'm trying to write data into an Excel file using ExcelJS library. I was successfully able to create worksheet and add column data.
However, while trying to implement addRow() or addRows() method, the data is not added into the Excel worksheet.
Here…

Shamees Ibn Yousaf
- 103
- 2
- 9
5
votes
2 answers
writeBuffer of ExcelJS doesn't return Buffer type
I'm using exceljs with Typescript in my project. But writeBuffer() function returns ExcelJS.Buffer instead of Buffer type. And since ExcelJS.Buffer inherits from ArrayBuffer, converting ArrayBuffer to Buffer will break excel file. Does anyone have a…

Tran B. V. Son
- 759
- 2
- 12
- 31
5
votes
2 answers
how to style header of exported file using excelJs
How can I custom style like border,color, width etc, of creating header in excelJs ?
I can style the rows of the sheet but not the header
fDay = days[0].charAt(0)
sDay = days[1].charAt(0)
sheet.columns = [
{header: 'Num', key: 'id'},
…

D. Ahmed
- 345
- 1
- 3
- 18
5
votes
1 answer
How to import EXCEL file in angular using exceljs
I want to read excel file using angular code.
my file is stored somewhere in my local system e.g, C:/data/test.xlsx
I have already tried loading with
readFile() & load() methods of exceljs.
they fail to read anything, instead they give error

Ravi Shankar Dubey
- 191
- 1
- 1
- 10
5
votes
1 answer
How to check cell values in different sheets using JavaScript and ExcelJS?
I have a spreadsheet with two sheets. Sheet 1 contains 3 columns with 100s of rows of data (strings). Sheet 2 is to be used as a mastersheet of correct combinations for Sheet 1 to be checked against to make sure the values in in cell are correct.…

dom_ahdigital
- 1,651
- 18
- 37
5
votes
3 answers
How to read xlsx file with ExcelJS?
How does the code should look like to get cell A1 value from the file "C:\1.xlsx"? I tried numbers of examples but still didn't managed to get it work.
var Excel = require('exceljs');
var workbook = new…

F. Vosnim
- 476
- 2
- 8
- 23