Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to show an image and pdf in a cards template of classic report

VS121Feb 11 2021

Hi
I have a combination of images/pdf that I need to display in a cards template of a classic report. I followed Joel R Kallmans 'Lets Wreck it together' blog (does not let me post links) and everything is working fine if all pics are either an image or a pdf but when its a combination, it breaks. I am displaying the picture in the html expression of CARD_TEXT
For images-
<img src="f?p=&APP_ID.:0:&SESSION.:APPLICATION_PROCESS=get_image_source:NO::G_ID:#ID#:" width="100%" height="10%"></img>
for pdfs:
<embed src="f?p=&APP_ID.:0:&SESSION.:APPLICATION_PROCESS=get_image_source:NO::G_ID:#ID#:" width="100%" height="10%">
To be able to do this I tweeked the select of the report as follows-
select apex_util.prepare_url('"f?p=&APP_ID.:0:&SESSION.:APPLICATION_PROCESS=get_image_source:NO::G_ID:"'||&P10_ID.||':')card_text
, null card_link
, null card_title
, null card_subtext
, mime_type
, decode(mime_type, 'application/pdf', '<embed src=', '<img src=' ) tag1
, decode(mime_type, 'application/pdf','width="400" height="300" type="application/pdf">','width="50%" alt="click to download"></img>')tag2
from <table>

And in the html expression I say #TAG1##CARD_TEXT##TAG2# and escape special characters selected to YES.

However it just displays the html expression as is in the card region as shown in pic. Atleast the rendering looks correct in that I have 2 images and 1 pdf and it assigns the img and embed tag appropriately but shows the expression as is instead of the actual image. How can do conditional rendering for images/pdfs and be able to display picture?
image.pngAppreciate your help!
Thanks

This post has been answered by fac586 on Feb 12 2021
Jump to Answer
Comments
Post Details
Added on Feb 11 2021
7 comments
1,197 views