Entries tagged img

Show Pictures in a Form on a Table with Report in APEX

Posted on 10. Dezember 2013 Comments

The table is called WPDBD_TEIL. The primary key is TID. In WPDBD_TEIL there is a column called BILD(german: picture/image) from type BLOB.

First click on your form and keep the name of the picture in mind. In this case, it’s P9_BILD.
report_bild

Then go to your report, click on edit for the whole report and use the following code

apex_editreport

select "TID", 
"TNAME",
"PREIS",
decode(nvl(dbms_lob.getlength("BILD"),0),0,null, '<img height="100px" width="100px" src="'||apex_util.get_blob_file_src('P9_BILD',TID)||'" />') "BILD"
from "#OWNER#"."WPDBD_TEIL"

If you’d open the report now, you only get the HTML Code. So you have to change the way APEX displays the entry. So go to the report, click on BILD and change Display as Text to Report Standard Column

 

edit_bildstandardreportcolumn

 

The form I used was the following.

formreport

Also, in the last page of creating the form, you have to chose your own primary key, not the ROWID.

 

primarykeyapexform