Wednesday, July 1, 2020

Oracle APEX - Show Image in Interactive Report (IR)

For Video Reference:

https://youtu.be/4HpNXB-Sf5Y

Step : 1

        Create a table with Image column as datatype BLOB and add two extra columns to store upload image file name and file type. Two column is used to download stored Image. Refer Image 1 to create table.

CREATE TABLE  BLOG_EMP_DTLS(EMP_ID     NUMBER(15), 
                            EMP_NAME VARCHAR2(150), 
                            EMP_DOJ DATE
                            EMP_IMG BLOB, 
                            EMP_FILE_NAME VARCHAR2(250), 
                            EMP_MIME_TYPE VARCHAR2(250)
                            CONSTRAINT EMP_ID_PK PRIMARY KEY (EMP_ID));

Step : 2

        Add Report with Form using the table.

Step : 3

        After Create report and Form.  Please change Source type in Report Region Property:

         Source --> Type - SQL Query

        Change the query which is given below.  Refere Image 3.

 SELECT ROWID,
        emp_id,
        emp_name,
        emp_doj,
        DECODE(NVL(DBMS_LOB.GETLENGTH(emp_img),0), 0, NULL, '<img alt="'||apex_escape.html_attribute(emp_name)
               ||'"style="border: 0px; -moz-border-radius: 75px; -webkit-border-radius: 75px;" '
               ||' src = "'||apex_util.get_blob_file_src('P11_EMP_IMG', ROWID)
               ||'" height = "35" width = "35" />') emp_img,
        emp_file_name,
        emp_mime_type
   FROM blog_emp_dtls

   P11_EMP_IMG is a page item. You assign your Form Page Item in that query.

Step : 4

        Select the Image column and change Escape Special Character to No.  After change that Property run the report it will the image.

Step : 5

        Go to Form Page select P11_EMP_IMG and go to Properties assign MIME type and File Name as which is mentioned in Table script. Refer Image 5.

Image 1:


Image 2:


Image 3:


Image 4:


Image 5:


Image 6:


Image 7:





No comments:

Post a Comment

Oracle APEX - How to show Images in Oracle APEX Interactive Report

 In this post, I can explain how to show images in Oracle APEX interactive Report. Table Script CREATE TABLE BLOB_IMAGES (BI_IMG_DESC VA...