-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to color cells dynamically ? #718
Comments
AA is not Cell position, its Column name did You try to use |
Sorry if Ive miss understood to question. But you can just loop the row then cells after the data have been added let rowValue = null;
worksheet.eachRow(function (row, _rowNumber) {
// toggle depending on this value I want rows to alter color
let rowValueTemp = row.values[3];
if (rowValueTemp) {
rowValueTemp = rowValueTemp;
}
if (rowValue !== rowValueTemp) {
toggle = toggle ? false : true;
}
rowValue = rowValueTemp;
row.eachCell({ includeEmpty: true }, function (cell, _colNumber) {
cell.border = {
top: { style: 'thin' },
left: { style: 'thin' },
bottom: { style: 'thin' },
right: { style: 'thin' }
};
if (toggle) {
cell.fill = <any>{
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FFA9A9A9' }
};
}
});
}); |
@Siemienik i have not used this |
@vegarringdal Thanks buddy! i will try this and let you know. |
@sahilbhatt92 |
For complete solution from extracting csv data -> sqllite -> excel have a look here |
@vegarringdal @Siemienik Thank you for your support. Issue finally resolved. |
Hi,
Scenario:
I have json below which i am converting it into excel.
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.
The text was updated successfully, but these errors were encountered: