Forum Stats

  • 3,855,301 Users
  • 2,264,499 Discussions
  • 7,905,965 Comments

Discussions

How to attach an image in xls report

739257
739257 Member Posts: 1
edited Dec 6, 2009 10:41AM in SQL & PL/SQL
Hi, 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.....')
Tagged:

Answers

  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    Two thoughts.

    The first is to ask Microsoft since it is their software.

    The second is to throw Excel away and get a real report writer like Business Objects or Cognos or one of the many report creating projects Oracle provides.

    Excel, by definition, is a violation of audit trail rules.
This discussion has been closed.