Search This Blog

About Me

My photo
Blog Written By Dr. Digvijaysinh D Virpura

Thursday, April 30, 2020

Display Image based on Column Value with Interactive Report in Oracle APEX

This post demonstrate the steps to display image based on the column value in the table with Interactive Report in Oracle APEX.


Simple Report:
 
Instead of Patient Risk value we need to get as shown below
Steps: 1    I have created a table as shown below.
      CREATE TABLE "DEMO_PATIENT"
      (   
        "PATIENT_ID" NUMBER(5,0) NOT NULL ENABLE,
        "PATIENT_NAME" VARCHAR2(50) NOT NULL ENABLE,
        "PATIENT_RISK" VARCHAR2(10) NOT NULL ENABLE,
   CONSTRAINT "DEMO_PATIENT_PK" PRIMARY KEY ("PATIENT_ID")ENABLE
       )
    /
In Above table Patient_Risk column can contain only two possible values. 1. High  2. Low 
So based on these values we will show images.
Step2:  Create a Report in your APEX Application 
                    
Step3: Type following query to get data.
 
Step4: Hide icon and icon_color columns
 
Step5: Go to Patient_Risk Column properties and set following value under HTML Expression.
<span class="#ICON#" style="color: #ICON_COLOR#"></span> 

 

=======================================================


Following could be another option
Change the query as shown below
 
Now hide risk_icon and risk_color column as we have done in last example.
Now select patient_Risk column and apply following code under HTML Expression


Output will look like 
 

Have a Happy Learning

Regards
Digvijaysinh Virpura
 
 

Unlock Oracle APEX Admin Account

There are some cases where user forget the password of admin account of Oracle Application Express Account.

Step1: Go to Command Prompt

Step2: Connect to Sysdba account of oracle database

Step3:  Execute following query

select username from dba_users where username like 'APEX%' order by 1;

 As i have APEX 19.1 installed it show the versions. 

Step4: Now you need to switch to APEX_SCHEMA which required resetting of password

SQL> alter session set current_Schema = APEX_190100

Step5: Unlock your admin account with following code.

 begin
      wwv_flow_security.g_security_group_id := 10;
      wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('ADMIN');
     commit;
end;