开发者

Load images onto a report dynamically in Apex

开发者 https://www.devze.com 2023-03-05 01:58 出处:网络
How can I load images dynamically i开发者_高级运维n place of cell data in a report in Oracle Application Express?

How can I load images dynamically i开发者_高级运维n place of cell data in a report in Oracle Application Express?

E.g.

A table has 'Y' and 'N' entries. When I display it as a report, I want to use certain images according to the data in the table. If it's a 'Y', display one image and if it's a 'N', display another image.


You can do this:

select id, 
       htf.img (case when flag='Y' then 'yesicon.png'
                                   else 'noicon.png' end) flag_icon
from   mytable
where  ...

You probably need to add a path for the filenames e.g. '#WORKSPACE_IMAGES#yesicon.png' etc.

If you will be using this a lot it would be worth building a function to simplify it:

select id, 
       mypkg.yesno_icon (flag) flag_icon
from   mytable
where  ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号