Search This Blog

About Me

My photo
Blog Written By Dr. Digvijaysinh D Virpura

Wednesday, September 16, 2020

Customize Interactive Report in Oracle APEX. (Color Rows if row have Specific Values)

 This blog will demonstrate steps to display column value with different color based on calculations.

Following is output of what we want to achieve.



Step1: Create an Interactive Report based on SQL Query.I have used following query.You can use your own as per your requirement.

select
    EMPNO,
    ENAME,
    JOB,
    DEPTNO,
    SAL,
    case when SAL < 3000 then 'red'
        when SAL between 1000 and 2000 then 'blue'
        when SAL > 3000 then 'green'
    end text_color
from EMP EMP


    Step2: Now go to Columns under Report and select Text_Color.

  Step3: Now set Type = Hidden Column

 

 Step4:  Now you have to set following code in each column under Column Formatting (HTML Expression)

 

<span style="color:#TEXT_COLOR#;font-weight:bold;">#SAL#</span>

Add same code in all the columns and you're done with report.

 

Have a Happy Learning

Regards
Digvijaysinh Virpura




No comments:

Post a Comment