In this Oracle APEX Tutorial, We will explore about the display images to report in Oracle APEX.
In this Section, I will share two different methods for display image in the Oracle APEX report. You can use these methods to display images into the classic report and interactive report in Oracle APEX.
Before we proceed in this section, I have already uploaded a video on this topic on my youTube channel if you want to learn this topic through video then click here. Show Image into a Classic report and Interactive Report in Oracle APEX.
Two ways to display images into classic report and interactive report in Oracle APEX
- Using IMAGE URL
- Using DBMS_LOB.GETLENGTH()
How to Display Image using the IMAGE URL in Oracle APEX Report?
First, You must have first create an image URL. How to Make an Image URL in Oracle APEX. After making the Image URL, use that URL into your SQL query. The below SQL query will help you.
select "EMPNO", "ENAME", "JOB", "MGR", "HIREDATE", "SAL", "COMM", "DEPTNO", case when MIMETYPE is null then '<img src="here you will use no found image URL" width="100" height="100" id="image1">' else '<img src="your image URL'||EMPNO||'" width="100" height="100" id="image1">' end Profile from "EMP"
After using image URL into the SQL query, Don't forget the change image URL column properties >security>Escape Special Character>No. The below screenshot will help you.
Using DBMS_LOB.GETLENGTH()
Create a Classic Report or Interactive Report type region using DBMS_LOB.GETLENGTH(). I am sharing a sample SQL query.
SELECT
EMPNO,
DBMS_LOB.GETLENGTH(IMAGE) IMAGE // Pass your table blob column
FROM
EMP
Now, Go to the Image Column and change column type properties with display image.The below screenshot will help you.
After Changing the column type with display image, Fill the BLOB Attributes properties.The below screenshot will help you.
After fill the BLOB Attributes, Now add column static ID. The below screenshot will help you.
Now images display into the reports, Using the below CSS code will fixed image width and height.
td[headers=image_width] img{
width: 75px !important;
height: 75px !important;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
That's all for today, I think display images into reports in Oracle APEX post will help. If this post help to achieve your task then please comment in the comment box.
2 Comments
Hello, the Classic Report not support Static Id Column?
ReplyDeleteHello Roberto, In Classic Report Give the Static Id to the Report Level image_width and use the this CSS Code in the page inline section #image_width img{
Deletewidth: 75px !important;
height: 75px !important;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
If you have any doubts, Please let me know