Monday, September 26, 2016

Oracle Apex report cell background color based on value

1. Create a report and set the report static ID: DD
2. Create a after refresh DA, put following javascript:

$("#DD tbody tr td[headers='STATUS']").each(function(){
     if ($(this).text() == 'Completed')
        $(this).css("background-color","#31f904").css('color','white');
     else if ($(this).text() == 'WIP')
        $(this).css("background-color","#22e5be").css('color','white');
     else if ($(this).text() == 'Pending')
        $(this).css("background-color","#ff0800").css('color','white');
});

Here I am using the STATUS col of the report, you can change that to your col and adjust the value/color based on your requirement

1 comment: