Hello there. So I have a gridwhich I can export to Excel.
When doing the export, I'm having two problems.
This is my function.
function
excelExport(e) {
var
sheet = e.workbook.sheets[0];
for
(
var
rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
var
row = sheet.rows[rowIndex];
for
(
var
colIndex = 0; colIndex < (sheet.columns.length-2); colIndex++) {
if
(row.cells[colIndex].value ==
"Weekend-"
) {row.cells[colIndex].format =
"[Blue];"
;}
if
(row.cells[colIndex].value ==
"Vacation Day-"
) { row.cells[colIndex].format =
"[Yellow];"
; }
if
(row.cells[colIndex].value ==
"Holiday-"
) { row.cells[colIndex].format =
"[Green];"
; }
if
(row.cells[colIndex].value ==
"Critical Task-"
) { row.cells[colIndex].format =
"[Red];"
; }
}
}
}
Problem Num1: Is there any other way to choose other colors?... I only found very few so far like these: Green, Red, Blue and Yellow. If I try colors such as Orange, Light Blue, Purple, which are colors that I really need, it doesn't work. Instead of "[ColorName;"], is there another way.
Problem Num2: With this format I'm only formatting the text itself, but what I really want is, for example, whenever in the cell there is the "CriticalTask-" value, I want the cell background color to be red.
Thanks for the help!