Display PDF file in the Apex query report using HTML Expression

Hi Folks,
I have PDFs stored in BLOB columns along with FILE_ID column in the database.
I want to display these to the APEX user on the page at runtime.
I have created a SQL Query report page to display FILE_ID column.
I am using HTML Expression property of the FILE_ID column to pull the image from the table using PROC_DISPLAY_DOCUMENT procedure.
I typed folowing code int the HTML Expression text area of the FILE_ID column of the report page :
<img src="#OWNER#.proc_display_document?p_id=#file_id#"/>
I am using following Procedure code:
create or replace procedure "PROC_DISPLAY_DOCUMENT"(p_id number) as
s_mime_type varchar2(48);
n_length number;
s_filename varchar2(400);
lob_image blob;
Begin
select MIME_TYPE,dbms_lob.getlength(blob_content),file_name,blob_content
into s_mime_type,n_length,s_filename,lob_image
from tbl_upload_file
where file_id = p_id;
owa_util.mime_header(nvl(s_mime_type, 'application/octet' ),false);
--set the size so the browser knows how much it will be downloading
htp.p( 'content-length: '|| n_length );
--The file name will be used by the browser if the users does a "save as" 
htp.p( 'content-Disposition: filename="' || s_filename ||'"');
owa_util.http_header_close;
--Download the BLOB
wpg_docload.download_file( lob_image );
exception
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-202121,'Record matching screenfield filename not found, PROC_DISPLAY_DOCUMENT.');      
end;
--This is very Important
--grant execute on PROC_DISPLAY_DOCUMENT to public;
This code does not work and report does not display PDF image.
Any help to troubleshoot this code will be appreciated.
Thank you in advance.
Jaya

Hi Dimitri,
I hope you can see HTML Expression code now. Thank You for responding.
I have PDFs stored in BLOB columns along with FILE_ID column in the database.
I want to display these to the APEX user on the page at runtime.
I have created a SQL Query report page to display FILE_ID column.
I am using HTML Expression property of the FILE_ID column to pull the image from the table using PROC_DISPLAY_DOCUMENT procedure.
I typed folowing code int the HTML Expression text area of the FILE_ID column of the report page :
[!--  img src="#OWNER#.proc_display_document?p_id=#file_id#" ]
I am using following Procedure code:
create or replace procedure "PROC_DISPLAY_DOCUMENT"(p_id number) **
mimetype varchar2(48);
n_length number;
s_filename varchar2(400);
lob_image blob;
Begin
select MIME_TYPE,dbms_lob.getlength(blob_content),file_name,blob_content
into s_mime_type,n_length,s_filename,lob_image
from tbl_upload_file
where file_id = p_id;
owa_util.mime_header(nvl(s_mime_type, 'application/octet' ),false);
--set the size so the browser knows how much it will be downloading
htp.p( 'content-length: '|| n_length );
--The file name will be used by the browser if the users does a "save as"
htp.p( 'content-Disposition: filename="' || s_filename ||'"');
owa_util.http_header_close;
--Download the BLOB
wpg_docload.download_file( lob_image );
exception
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-202121,'Record matching screenfield filename not found, PROC_DISPLAY_DOCUMENT.');
end;
--This is very Important
--grant execute on PROC_DISPLAY_DOCUMENT to public;
This code does not work and report does not display PDF image.
Any help to troubleshoot this code will be appreciated.
Thank you in advance.
Jaya

Similar Messages

  • HT5678 I have problems saving pdf files in the web when I use Safari. I don't have this problem with firefox

    I have problems saving pdf files in the web when I use Safari.  I don't have this problem with firefox.

    do they save ok if Safari - Preferences - Security - Allow all other plug-ins is unchecked ?
    If so, likely an adobe or other pdf plugin
    Re-check the setting above & quit any browsers,
    Look in this folder by triple-clicking the line below, then ctrl-clicking it & choosing Services - Open
    /Library/Internet Plug-Ins/
    remove anything with pdf in the filename & test again
    Sometimes, plug-ins can be in the User Library folder :
    ~/Library/Internet Plug-Ins/

  • How to display PDF file, inside the SWF file or flash exe file

    I  have create the application for Employee details using flash actionscript 3.0
    This application is to view the organization employee details, iam using the tree component in this application,
    the tree component is to get the dada via xml file, this xml file save in the remote server ,
    I display the PDF file inside the swf file to using " StageWebView" class . Then i goto Publish Setting to change the  player Adobe Air 2.6 and run the flash file using
    ctr-l + Enter . It is work correctly the PDF file is Displayed inside the Swf Output. But I Publish this file to exe . then i run the exe it is not working .
    The application is run The xml data is onely get and displayed the Tree component then i click the tree item employee name the xml data in not display and the pdf file is not open .
    Pls Help...................

    hi i need to display the pdf file inside the swf file or flash exe file .
    I use the navigateToURL class this is open the pdf file on the browser. I want to display the pdf file in the swf window .
    Please suggest.

  • A problem displaying PDF file in the Web Browser layout.

    I'm hoping someone can help me with this issue.  I need to display my PDF documents in the web-browser layout as part of my daily job.  I use JAWS 14, and many times, when my document is launched, it comes up blank, or at least that's what JAWS reports.  If I press the F5 key to refresh the page, then it displays properly.  I need the document to show up properly when it is initially loaded.  How can I accomplish this?    

    I'm hoping someone can help me with this issue.  I need to display my PDF documents in the web-browser layout as part of my daily job.  I use JAWS 14, and many times, when my document is launched, it comes up blank, or at least that's what JAWS reports.  If I press the F5 key to refresh the page, then it displays properly.  I need the document to show up properly when it is initially loaded.  How can I accomplish this?    

  • Displaying PDF files (stored as BLOBs in Database) using Forms 6i

    Hi,
    We have PDF and Word documents stored in Database (Version 8.1.7). We are using Oracle Forms 6i as User Interface. Through Forms we could view word documents which are stored in database, using OLE container.
    But we could not view PDF files.
    It would be more helpful and valuable if I get ideas/suggestions on this.
    Thanks in advance,
    Umasankar

    Frank,
    You are correct, I totally agree with you.
    TOAD software which i suggested was not for user interface but more for testing purpose - To ensure that the documents is uploaded to BLOBS correctly.
    I am not a WEB person, but I believe sugnificant coding is required in forms6i/9i with WEB features to display the respective documents.
    If, the purpose in ONLY for testing, then TOAD can be used which requires no coding.
    -- Shailender Mehta --

  • Displaying PDF file in forms running on UNIX server

    I want to display a PDF document in the form.
    I have explored the following two options:-
    1) Using Image item - PDF format is not supported by forms
    2) OLE - Is supported only on WIN and MAC
    Does any body know of any reusable java bean that can be used to display PDF file inside the form?
    Thanks

    Java Beans only work on the Web. If you are on teh Web then an option would be to reference to the pdf document by using web.show_document() built-in
    Frank

  • Display pdf file using webdynpro abap

    Hi Friends,
    My requirement is to display pdf file in the second page with the input  text  entered in the fisrt page when clicked on action
    button( in the first page) using webdynpro abap.
    Can anybody explain the step by step procedure as I am new to this area.
    Thanks in advance.
    Reagrds,
    Nagaraju

    Hi,
    Check this.,
    Creating a PDF file in webdynpro abap.
    Web Dynpro ABAP display pdf
    hope this helps u.,
    Thanks & Regards
    Kiran

  • Can't download pdf files from the internet?

    I can't seem to download my utility bill pdf files from the internet? I use to but in the last few months i haven't been able to. Can anyone help, please?

    What is your operating system & version?
    What web browser do you use?
    What is your Reader version?
    What exactly means "can't"?

  • How to get the output .pdf file of a quiz to report to the quiz results analyzer on my internal server (mamp)

    I created a quiz.
    Created an internal server on my compute rising a MAMP.
    When I publish my quiz using the multi-file publishing options...
    I am able to use both the "HTML" and the "swf" output files to complete a quiz and reporting the results to the quiz results analyzer.
    However, I am unable to get the output .pdf field to reporting to the quiz results analyzer.
    Any help? Would this issue have to do with the Acrobat Professional setting? Captivate setting? My internal server setting? or output fuel placement?
    I tired to put the .pdf file in the same MAMP root folder location as my "internalserverreporting.php and internalserverread.php files.
    Thanks for the help.

    Hello Varun,
    You cqan submit the report as a JOB and export the out put to memory, once the job is complete you can read the list to display the output.
    Cheers,
    Mano
    Cut & Paste form SAP help.
    Submit report ....
    EXPORTING LIST TO MEMORY
    Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".

  • How to Display PDF File on Oracle Report 10g

    Dears,
    i have a PDF File on the server,
    also i need to display this file into rdf report.(Embed the PDF file into Report)
    Regards

    Dear Inol,
    I have the same problem I want to embded a PDF, word Doc OR Image in report 10g.
    And I put the read from file property YES and File Format OLE2
    and it doesnt work by run_web_report by repport server. while in run report layout it works.
    And my report server on the same Pc "The file path on the same server". or you can say that im working on the server where the path of the file exists and it doesnt work also.
    So what do you think that i have to do to solve this problem.\
    by the way i try to Genarate the report to a file in spacefic path then open it. and it didnt work also.
    any help will be apreciated.
    thanks in advance.
    Ashraf

  • Preview: In a group of PDF files in the same window, going to the next or a previous PDF file displays the bottom of PDF by default, not the top. How do you change this?

    Preview: In a group of PDF files in the same window, going to the next or a previous PDF file displays the bottom of PDF page by default, not the top of the PDF page. How do you change this? In Mac OS 10.9 and previous, going to the next or previous PDF file displays the top of the PDF by default. Is there a way to change this back? When I go to the next or previous PDF file, I want to first view the top of the page, not the bottom. This really doesn't make any sense. Any help? Thanks!
    MacBook Air (13-inch, Mid 2012)
    2 GHz Intel Core i7
    8 GB 1600 MHz DDR3
    500 GB Flash Storage
    Preview Version 8.0 (859)
    Mac OS 10.10.1

    That to me seems like a bug in Yosemite.
    Apple Feedback http://www.apple.com/feedback/
    Bug Reporter https://bugreport.apple.com/

  • I need to configure Acrobat to display PDF files in Safari, but I have a lot of troubles to do it.I have OX S yosemite, I unistalled adobe acrobat, I closed safary and I installed the new version of adobe acrobat.

    Dear everyone
    I need to configure Acrobat to display PDF files in Safari, but I have a lot of troubles to do it.
    I read a european commission document explaining that
    http://ec.europa.eu/research/participants/data/support/sep_usermanual.pdf
    If Safari does not display pdf forms in the browser window, uninstall all older versions of Adobe Reader and download the most recent one. First close Safari and then install Reader. Launch Safari and you ought to be able to open the pdf files inside the Safari window. If you install Adobe Reader 10.1.x without first closing Safari, Safari will not display the pdf file inside its browser window until it is re-launched. For further help, please see http://helpx.adobe.com/acrobat/kb/troubleshoot-safari-plug-acrobat-x.html
    I have OX S yosemite, I unistalled adobe acrobat, I closed safary and I installed the new version of adobe acrobat
    but when I open a web page that I need to allow me to display and modify PDF files it is not working.
    I checked the following web page
    Troubleshoot Safari plug-in | Acrobat X, Reader X
    that is recommending the following:
    The AdobePDFViewer plug-in is used to display PDF files in Safari using Acrobat and Reader.
    This plug-in is installed as part of the Acrobat X or Reader X installation. The location of this plug-in is:
    /Library/Internet Plug-ins/AdobePDFViewer.plugin
    but after the new installation with this folder is completely empty and I am still
    unable to open these pdf.
    Does anybody knows anything else I can do?
    Best regards
    Ramon

    Moving this discussion to the Adobe Reader forum.

  • Lately pdf files from the Web do not display properly; what is wrong and how can I fix it so I don't have to use IE?

    I am a professor and frequently need to open pdfs of academic journal articles from electronic databases. Within the last two or three weeks, when I try to do this using Firefox, only the first page of the pdf displays and the rest are blank. In addition, a bar appears across the top with the message "This pdf file may not display properly." So I have had to switch to Internet Explorer to open the files and do my research. What is going on and how can I fix it so I can open pdf files from the Web in Firefox and have them display properly?

    My question is simple - why would you put an application in production that has a lot of bugs? To replace a good and steady Adobe product? My customers will believe that I put a pathetic fallible form online. They are not sophisticated on computers so I just tell them to use IE. Ugh
    I must agree with pgwebgirl!

  • Genrating Report as PDF File on the hard disk

    Hi All,
    I am using Oracle developer 10g, I need when I call the report from the forms to generate the report to a PDF file on the c:\ drive instead of appearing on the screen.
    I set the DESFORMAT to PDF, DESTYPE set to FILE and DESNAME set to C:\filename.pdf.
    Thanks

    Hello,
    When using DESTYPE=FILE , the output will be generated on the machine where the Reports Server is running .
    If you want to generate the PDF file on the "Client PC" (the PC where the Forms Applet is running), you will have to transfer the PDF from the
    "Application Server machine" to the "Client PC"
    Webutil can be used to do that : http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm
    Regards

  • Html db to display pdf files saved as blob in the data base

    Hi all,
    I have a DB page to call next page to display pdf files.
    A procedure is being called when the link is clicked on the first page.
    However, the procedure output a juck code insteand the pdf files. Please help.
    Thanks,
    n_length number;
    n_image BLOB;
    begin
    select note_image, dbms_lob.getlength(note_image)
    into n_image, n_length
    from n100_notes where note_id = nid;
    owa_util.mime_header('application/pdf');
    htp.p('Content-length: ' || n_length);
    wpg_docload.download_file(note_image );

    we use:
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;
    wpg_docload.download_file(l_blob);
    see plpdf.com
    LL

Maybe you are looking for

  • IPhone 4/iOS 5:  Constant usage time increase while phone is in standby.

    When connected to any of the 3 WiFi access points at my job site, the phone's usage time meter increments constantly even with the phone is in standby. I have tested repeatedly for periods of one hour, and at the end of an hour, there will be only ro

  • PC00_m40_PF(In production)

    HI, when i am executing PC00_m40_PFY  standard report in production server i am getting the below mention Dump..It is not showing selection-screnn also. It directly goes to dump. But it is working in Development server. pls kindly help on this issue.

  • Create SQL Job with Invoke-Sqlcmd

    I'm trying to run a set of .sql files, i didn't know how to pass a common variable to all, so i've started running the statements directly in ps.  One of these creates a job but i'm running into all of the errors due to the special characters and the

  • Getting images stored inside aknown folder..

    Hello, I have aprogram that generate apictures and save them at known path.say " C:/images", then each image is assignes a random number in an accending way. Now i want away to get the name of the images inside the folder at the path " C:/images" by

  • 1097 error calling DLL

    Hi, I am a student currently doing an internship, and I may need some help. First of all, I am a beginner with LabVIEW, so maybe what I am asking is silly but I am completly lost. In my project, I have to command a CD/DVD reader manually (speed of ro