Requirement:
STOCK_FLAG = 0 → White
STOCK_FLAG != 0 → Red
Step 1: IR Region Static ID দাও
Interactive Report → Region
Static ID: stock_ir
Step 2: STOCK_FLAG Column Static ID দাও
Static ID: STOCK_FLAG
Step 3: Page → CSS (Inline CSS)
/*STOCK_FLAG = 0 then row color Red */
.stock-red td {
background-color: #ff4d4d !important;
color: white !important;
}
/* for column hide. you can't use column type: Hide*/
td[headers="STOCK_FLAG"],
th#STOCK_FLAG {
display: none;
}
Step 4: JavaScript (Execute when Page Load)
Dynamic Action → Event: Page Load
Action: Execute JavaScript
var region = $("#stock_ir");
// loop through rows
region.find("tbody tr").each(function () {
var stock = $(this).find("td[headers='STOCK_FLAG']").text().trim();
if (stock !== "0" && stock !== "") {
$(this).addClass("stock-red");
}
});
Step 5: JavaScript (Execute when After Refresh)
Dynamic Action → Event: After Refresh
Action: Execute JavaScript
var region = $("#stock_ir");
// loop through rows
region.find("tbody tr").each(function () {
var stock = $(this).find("td[headers='STOCK_FLAG']").text().trim();
if (stock !== "0" && stock !== "") {
$(this).addClass("stock-red");
}
});
