question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to color cells dynamically ?

See original GitHub issue

Hi,

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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Siemienikcommented, Jan 11, 2019
1reaction
sahilbhatt92commented, Jan 24, 2019

@vegarringdal @Siemienik Thank you for your support. Issue finally resolved.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found