To fix the printing of background colors, I had to add “!important” after each color that I set using the renderer code. Please see my code sample below. Without “!important” colors would not appear in print preview or on the printer output.
var Statusrenderer = function (row, column, value) {
if (value == “OK”) {
OTS = false;
return ‘<div style=”font-weight: bold; font-size: 24px;background-color: green!important;text-align:center;”>’ + value + ‘</div>’;
}
else if (value == “OK-“) {
OTS = false;
return ‘<div style=”font-weight: bold; font-size: 24px;background-color: yellow!important;text-align:center;”>’ + value + ‘</div>’;
}
else if (value == “OTS”) {
OTS = true;
return ‘<div style=”font-weight: bold; font-size: 24px;background-color: red!important;text-align:center;”>’ + value + ‘</div>’;
}