How to attach an image in xls report
739257Dec 6 2009 — edited Dec 6 2009Hi, does anyone knows how to insert an image in excel report?..
We'd been working this for so long and it seems that the report cannot locate/render the image properly ..
I hope someone can give me some tips and help..
Thanks ..
--original sql code TEXT format
OWA_UTIL.MIME_HEADER('application/vnd.ms-excel', TRUE, 'MaGiC_KeY');
HTP.P('Content-Disposition: attachment; filename="' || V_RPT_TITLE_NO_SPACE || '.xls"');
OWA_UTIL.HTTP_HEADER_CLOSE;
--end of original sql code
--begin DEV mode Insert Image - Logo
--OWA_UTIL.MIME_HEADER('application/vnd.ms-excel', TRUE, 'MaGiC_KeY');
owa_util.mime_header( 'application/octet-stream', FALSE );
htp.p('Content-Type: application/ms-excel');
HTP.P('Content-Type: multipart/related; boundary="----=_NextPart_01CA74F8.C8882F00"');
HTP.P('------=_NextPart_01CA74F8.C8882F00');
htp.p('Content-Disposition: attachment; filename="filename.xls"');
-owa_util.http_header_close;
--end DEV mode
base64 code (image)
HTP.P('------=_NextPart_01CA74F8.C8882F00
Content-Location: file:image001.jpg
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAUAAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQAAgICAgICAgICAgMCAgIDBAMCAgMEBQQEBAQEBQYFBQUFBQUGBgcHCAcHBg.....')