Logout
Home
Record Navigation with IR Filters
Enhanced IR headers
IR Quickfilter with all columns
Record Duplication
Working with the tree
Classic report - row color
OTN Thread
How to create a template for more than four column conditions?
Of course this is just one solution. Paul's solution in that thread will work just as well. But you need to alter your SQL in order for that to work.
On the other hand, in my example you at least need to understand what is being targetted and checked by jQuery!
Classic report with conditional row colour
ConditionDescriptionCol1Col2
1test case 1another column 1yet another column 1
2test case 2another column 2yet another column 2
3test case 3another column 3yet another column 3
4test case 4another column 4yet another column 4
5test case 5another column 5yet another column 5
6test case 6another column 6yet another column 6
7test case 7another column 7yet another column 7
8test case 8another column 8yet another column 8
9test case 9another column 9yet another column 9
10test case 10another column 10yet another column 10
11test case 11another column 11yet another column 11
12test case 12another column 12yet another column 12
1 - 12
Code
Page - Inline CSS:
#rTest tr.condition1 td{
background-color: yellow;
}
#rTest tr.condition2 td{
background-color: pink;
}
#rTest tr.condition3 td{
background-color: red;
}
#rTest tr.condition4 td{
background-color: green;
}
#rTest tr.condition5 td{
background-color: gray;
}
#rTest tr.condition6 td{
background-color: blue;
}
#rTest tr.condition7 td{
background-color: purple;
}
#rTest tr.condition8 td{
background-color: orange;
}
#rTest tr.condition9 td{
background-color: gold;
}
#rTest tr.condition10 td{
background-color: olive;
}
#rTest tr.condition11 td{
background-color: sienna;
}
#rTest tr.condition12 td{
background-color: lightseagreen;
}
Report:
  • Report Static ID: rTest
  • Report SQL
    select level condition, 'test case '||level description, 'another column '||level col1, 'yet another column '||level col2
    from dual
    connect by level <= 12
    
Dynamic action:
  • After Refresh on report region
  • True action:
    • Fire on page load: yes
    • Execute javascript code
    • Code:
      $("#report_rTest table.report-standard td[headers='CONDITION']").each(function(){
         $(this).closest("tr").addClass("condition"+$(this).text());
      });
      
This code will read the text in the CONDITION column per row, and apply a class to the row element: "condition" concatenated with the text in the cell.