Unable to color cells dynamically ?
See original GitHub issueHi,
Scenario: I have json below which i am converting it into excel.
const arr = [{"Name": "my Name", "age": "again my age", "sampleCol1": "", "sampleCol2": "", .... n}]
In Excel (the position of keys and values would be):- Key: Position Name: A1 age: B1 sampleCol1: C1 sampleCol2: D1 …n
Value: Position my Name: A2 again my age: B2 “”: C2 “”: D2 …n
Problem: Fill (property) only accepts cell positions such as AA, AB that i cannot get from array index.
arr.forEach((item, index) => {
// is there any solution that array index can be used as cell position.
const cellPosition = index;
worksheet.getCell(cellPosition).fill = {
type: 'pattern',
pattern:'darkVertical',
fgColor:{argb:'FFFF0000'}
}
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Unable to color cells dynamically ? · Issue #718 - GitHub
Hi,. Scenario: I have json below which i am converting it into excel. ... Problem: Fill (property) only accepts cell positions such as...
Read more >unable to change Colour of excel cells dynamically in jasper ...
Iam using TIBCO jasper studio for generating excel report. I am not able to change the back color of a cell based on...
Read more >sapui5 - CSS style cannot be set dynamically (Cell color)
To dynamically add CSS classes/ change the colour of things like cells etc the best solution I have generally found is using custom...
Read more >How to dynamically set a cell's background color based on ...
How to dynamically set a cell's background color based on value from another worksheet in the same Excel 2010 workbook.
Read more >How to change background color in Excel based on cell value
Click the Format… button and choose the needed background color on the Fill tab (for detailed instructions, see step 5 of "How to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sahilbhatt92 https://github.com/exceljs/exceljs/blob/master/lib/doc/worksheet.js#L170 string (eg.
A
) or number (eg.1
for columnA
)@vegarringdal 👍
@vegarringdal @Siemienik Thank you for your support. Issue finally resolved.