Colour RTF Template in Oracle 12.1.3 or later.
Business Requirement
This report is used to analyze the HR to find out the Salary Percentage of the Employees.
Example:
The below example shows how to set a background Colour on every other row based on Employee Salary.
If Employee (SALARY>=4500 and SALARY<=100) then background Colour set to #ffffba
If Employee (SALARY>=4500) then background Colour set to #baffc9
If Employee (SALARY<=500) then background Colour set to #ffb3ba
If the above condition is not satisfied then background Colour is set to default Colour (i.e White)
We are using “when” and “otherwise” condition tag to handle background Colour.
<?choose:?> <?when:(SALARY<=4500 and SALARY >=2000)?>
<?attribute@incontext:background-Colour;#ffffba?>
<?end when?>
<?when:(SALARY>=4500)?><?attribute@incontext:background-Colour;#baffc9?>
<?end when?>
<?when:(SALARY<=500)?><?attribute@incontext:background-Colour;#ffb3ba?><?end when?>
<?end choose?>
Note: There is limit in BI Publisher to enter conditions in Form Field (i.e. 138 characters).
But in Advanced tab, we can enter 393 characters.
Sample RTF:
Last Name | First Name | Hire Date | Salary |
---|---|---|---|
Sample XML File:
Sample Output:
SALARY>=4500 and SALARY<=100
SALARY>=4500
SALARY<=500