Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Images stored in database are not displayed in apex report. Report shows string value instead of the images, how do I solve this?

I am busy with app migration from apex 4.2 to apex 5.1. I have already created the pages and exported the data in the database (DBeaver). I want to display images in a report in apex 5.1. But the images are not displayed. I am not sure what the problem is. this is my code to display the report.

select m.ID, 
m.CATEGORY_ID,
S.CATEGORY_NAME,
e.name || ' ' || e.surname,
m.CONTACT_DETAILS,
m.IS_ACTIVE,
M.UPDATED_ON,
m.UPDATED_BY,
M.CREATED_ON,
m.DESCRIPTION,
count(r.id) Replies,
decode(nvl(dbms_lob.getlength(PHOTO),0),0,null,'<img onclick="javascript:showImage(this);" src="'||apex_util.get_blob_file_src('P46_PHOTO',m.ID) 
|| '" ALT="See full size" height="50" width="50" />') "PHOTO"
from COM_ADVERT_TB m, com_advertcategory_tb s, Com_replyadvert_tb r, system_username_tb e
where m.category_id = s.category_id(+)
and m.created_on >= to_date('01-01-2018 00:00:00', 'dd-mm-yyyy hh24:mi:ss')
and   m.id= r.id(+)
and upper(m.username) = upper(e.username)
group by m.ID, 
m.CATEGORY_ID, 
S.CATEGORY_NAME,
e.name || ' ' || e.surname,
m.CONTACT_DETAILS, 
m.IS_ACTIVE, 
M.UPDATED_ON, 
m.UPDATED_BY, 
M.CREATED_ON, 
m.description,
decode(nvl(dbms_lob.getlength(PHOTO),0),0,null,'<img onclick="javascript:showImage(this);" src="'||apex_util.get_blob_file_src('P46_PHOTO',m.ID) 
|| '" ALT="See full size" height="50" width="50" />')
order by created_on desc

This is how the pictures are displayed in the report:

Report displaying images

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

instead of showing the images it displays this string values. I want it to show like this:

Report displaying images

Kindly assist, I think something is wrong with the code on how I am displaying the images. How do I solve this?

>Solution :

To me, it looks as if you’d have to turn the "Escape special characters" property for the PHOTO item OFF:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading