Making apex_util.get_print_document return an error message

We are using apex_util.get_print_document in a process to run a report something like this:
declare
   l_report blob := null;
begin
    l_report := apex_util.get_print_document (
        p_application_id      => :APP_ID,
        p_report_query_name   => 'report_query_name',
        p_report_layout_name  => 'report_layout_name',
        p_report_layout_type  => 'rtf',
        p_document_format     => 'rtf'
   if l_report is not null and dbms_lob.getlength(l_report) > 0 then
      apex_application.g_print_success_message := 'Report Created.<br>';       
      INSERT INTO reports (attachment, date_created, filename, mime_type)
      VALUES (l_report, sysdate, 'report.rtf', 'text/rtf' );       
   else       
      apex_application.g_print_success_message := '<span style="color:#CC0000">There was a problem creating the report.</span><br>';   
   end if; 
end;And this works well most of the time. The problem is, if the report fails for some reason, apex_util.get_print_document gives no information whatsoever as to what went wrong. Is there any way at all we can find out what the problem was?
Application Express 4.0.2.00.07
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

Hi,
add exception to your code.
declare
   l_report blob := null;
begin
    l_report := apex_util.get_print_document (
        p_application_id      => :APP_ID,
        p_report_query_name   => 'report_query_name',
        p_report_layout_name  => 'report_layout_name',
        p_report_layout_type  => 'rtf',
        p_document_format     => 'rtf'
   if l_report is not null and dbms_lob.getlength(l_report) > 0 then
      apex_application.g_print_success_message := 'Report Created.<br>';       
      INSERT INTO reports (attachment, date_created, filename, mime_type)
      VALUES (l_report, sysdate, 'report.rtf', 'text/rtf' );       
   else       
      apex_application.g_print_success_message := '<span style="color:#CC0000">There was a problem creating the report.</span><br>';   
   end if; 
EXCEPTION
   WHEN OTHERS THEN
      raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
end;This will give proper error message.
Hope this will helps you.
Regards,
Jitendra

Similar Messages

  • My iCal won't go online and returns the error message: The server responded with "500" to operation CalDAVAccountRefreshQueueableOperation.

    My iCal won't go online and returns the error message: "The server responded with “500” to operation CalDAVAccountRefreshQueueableOperation."

    OK Now I can answer my own question.  The incomprehensible (inexcusably geeky) error message is actually Apple language for saying simply: "The iCloud servers are down again.  Please wait until we've fixed them."  I found this out by talking to Apple support.  It took about 12 hours for the iCloud server synching calendars to come back online.  When they did, my calendar reloaded, and everything was fine.

  • I recently just bought a Toshiba 3TB External Hard Drive.  I am trying to partition it on my macbook, but it keeps returning and error message.  The only thing I have changed is renamed easy drive.

    I recently just bought a Toshiba 3TB External Hard Drive.  I am trying to partition it on my macbook, but it keeps returning and error message.  The only thing I have changed is renamed easy drive.

    Your problem is not Boot Camp, in fact, is your optical drive. Win XP requires indeed sp2, but also the internal drive, does not work from external optical drive.
    For other possible tricks, please use the appropriate Boot Camp forum, not here. Mac OS X may be installed from both external and internal optical drive and/or internal/external partition of a disk, any disk. Windows is not so generous.

  • After renaming my MAC hard drive, Acrobat, Illustrator and Bridge fail to launch. Acrobat returns the error message "An internal error occurred". I've checked this out and it seems related to user permissions. The version is Acrobat X. My machine has mult

    After renaming my MAC hard drive, Acrobat, Illustrator and Bridge fail to launch. Acrobat returns the error message "An internal error occurred". I've checked this out and it seems related to user permissions. The version is Acrobat X. My machine has multiple user accounts. Any help would be appreciated. I renamed the drive to its original name but to no effect. RR

    I resolved the issue.
    The problem is indeed a permissions issue with the Adobe Application Support folder.
    First, in MAC OS Lion the ~/Library/ folder is hidden by default. You must unhide it in order to proceed. (if it is already visible in your ~/User/ folder, proceed to Step 4.)
    Next launch the Terminal application.
    At the command line, paste the following command line: chflags nohidden ~/Library/
    Go to /Users/youruserid/Library/Application Support/Adobe
    Get info on the ~/Adobe folder and reset your permissions to read/write and apply to all enclosed folders
    Problem solved. RR

  • Watch Folder Returned an error message(Elements 10)

    I recently upgraded from elements 8 to version 10, and am having nothing but trouble in one area. When I start Elements, the box will come up saying "updating", and will take sometimes 18 hours to go to 100%, even if there have been no photos to add. Whe it gets to 100%, I get this message:  "The watch folder service returned and error: Message format, Invalid Tag Id"
    Has anyone heard of this? Should I reinstall elements and start over? The program is basically unusable. I'm stumped and normally very good at this. I'm running a fast desktop, windows 7, etc. Please help!

    Hi,
    I'm not sure which step solved the issue however I run a security software on my Mac so I disabled that completely.
    Then I located iMovie in the APP Store and instead of a button saying BUY it was labeled as INSTALL.
    So having done those 2 steps, iMovie went ahead and updated to 10.0.4.
    My guess is the security software was blocking the update somehow.
    Hope this helps.
    Cheers

  • Apex_util.get_print_document returns empty blob

    Hi,
    I'm trying to convert a xsl-fo template into PDF. I have the following code:
    begin
    declare
    v_retval blob;
    v_data blob;
    v_xls clob;
    v_xml_dat clob;
    begin
    select page_template
    into v_xls
    from flows_030100.wwv_flow_report_layouts
    where flow_id =101
    and report_layout_name = 'vv';
    v_xml_dat := to_clob('<data><row><dat1>fff</dat1></row></data>');
    v_data := wwv_flow_utilities.clob_to_blob(v_xml_dat);
    v_retval := apex_util.get_print_document (v_data,v_xls,'xsl-fo','pdf')
    htp.p(dbms_lob.getlength(v_retval));
    end;
    end;
    This returns 0 instead of some PDF document. I guess there is something wrong with my input, probably the XML data. Any thoughts?

    Anyone?

  • Won't let me subscribe to any free podcasts and returns a error message

    I'm on version 9.2.1.4. Everything else works fine, but I can't subscribe to any podcast (audio or video) from the itunes store. I have tried several different podcasts, uninstalled and reinstalled, but all have the same result. When I try to subcribe it says it is "accessing itunes store" and that's as far as it gets, then the error message reads that pops up reads "We could not complete your itunes store request. The request timed out. There was an error in the itunes store. Please try again later". This has been going on for a few days. Please help Apple!!!!!!!

    Go to Itunes, then click on "Edit", and then "preferences". Under the tab labeled, "General", make sure the box next to "show podcasts" isn't unchecked, that may be why you cant subscribe to anything. Check it off, and you should be good to go. If that doesn't work, look under the tab "parental controls", and make sure the box isn't checked for "disable podcasts".
    Hope that helps!
    Dell   Windows XP  

  • Tried sending via a list (contains my own address twice), send folder is updated, no email returned, no error messages returned

    T'bird 32.1.0.
    I send a newsletter each week to 3 different mailing lists. (my own address is on first list.)
    Today I got no error messages. Sent folder contained confirmation copies. No one received a copy.
    I created a new list, 2 entries - both my name - sent. No errors. No e-mail message sent.
    Suggestions?

    You don't need to use, and shouldn't be using Bcc: in mail merge. Each message is addressed to just one recipient. Since that message is uniquely addressed there's no point or value in hiding the addressees. So you just use To:. Your CSV file attempt sounds better suited, but it can be very picky about the CSV file structure, using quote marks to include spaces and so on.
    I don't have any real use for mail merge myself so can't speak for its usefulness or performance. When I have tried even small mailings to just a few of my own email addresses, it seemed a bit fragile and prone to stopping and getting stuck, leaving you with no clear idea of which messages had been sent and which needed to be attempted again.
    The mail merge built into the open office/libre office suites seems to work rather better.

  • Starting Adobe Photoshop Elements, the Editor returns the error message "Unable to continue because

    installed photoshop elements 8.0 with Windows 7. Worked excellent till two days ago. I got the error message "Unable to continue because of hardware or system error. Removed programm and re-installed from disk, no results!

    Are you trying to open the Organizer or the Editor?
    Can you uninstall that driver, or re-set Win7 to a restore point before that driver was installed?
    There's also this Adobe troubleshooting document:
    http://helpx.adobe.com/x-productkb/global/troubleshoot-system-errors-freezes-windows.html
    Ken

  • Photomerge in PSCC latest update returns an error message

    Unable to use Photomerge in Photoshop CC latest update 14.1.2x64. IU get the following error message
    How do I correct this issue? Thanks,

    Hi Chuck,
    Do you recall if Photomerge was working before updating to 14.1.2? It is curious that the file is not present. Are there any files in the Stack Scripts Only directory?
    I think you'll need to uninstall first, then use the Creative Cloud [CC] (desktop) application to install. You can download via the web portal also, and it will invoke the CC app to install. Once that install is done, you'll want to then update to 14.1.2. (you might have to quit and relaunch CC in order for it to notify you of the update availability).
    regards,
    steve

  • How configure 9iAS logon to return database error messages (i.e., user locked)

    When the database user is in locked status or the user's password has expired the Apache logon returns a generic screen 'Database Log In Failed' after three attempts. When you logon outside the web interface then you get the error number and message returned. How can Oracle Apache be configured to return the database errors at logon.

    Mayu,
    Look at what is done in the UpdateAction code.
    try
    catch (JboException ex)
    errors = buildErrorsFromException(request, ex);
    Then call saveErrors on the action:
    saveErrors(request, errors);
    In the html you need to display the error using the errors tag:
    <html:errors/>
    An other way to do it but not as flexible is to use a global exception.
    <global-exceptions>
    <exception type="oracle.jbo.JboException" path="/errorpage.jsp" key="globalerror.jboException"/>
    </global-exceptions>
    You would list the specific exception and errorpage needed.
    Charles.

  • How to return an error message from a zbapi that I have written

    Hello Friends
    I have written a simple ZBAPI that I have created. Here is the simple code that I have written which just inserts some value. How can I send information back using BAPIRETURN if the insertion was not successfull.
    Is it enough just to define BAPIRETURN in the EXPORT TAB or is there any extra coding I have to do?
    Your response or feedback will be greatly appreciated.
    Following is the simple code of insertion that I have written.
    FUNCTION ZBAPI_ADD_CONFIG.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(CONFIG_DATA) TYPE ZCONFIG_STRUCTURE
    *" EXPORTING
    *" VALUE(MESSAGE) TYPE BAPIRETURN
    tables: ZDAMPER_CONFIG.
    ZDAMPER_CONFIG-CONFIG_ID = CONFIG_DATA-CONFIG_ID.
    ZDAMPER_CONFIG-APPL_FILE_NAME = CONFIG_DATA-APPL_FILE_NAME.
    ZDAMPER_CONFIG-APPL_VER = CONFIG_DATA-APPL_VER.
    ZDAMPER_CONFIG-CONFIG_DESC = CONFIG_DATA-CONFIG_DESC.
    ZDAMPER_CONFIG-CONFIG_EXT_QTY = CONFIG_DATA-CONFIG_EXT_QTY.
    ZDAMPER_CONFIG-CONFIG_STATUS = CONFIG_DATA-CONFIG_STATUS.
    ZDAMPER_CONFIG-CONFIG_TYPE = CONFIG_DATA-CONFIG_TYPE.
    ZDAMPER_CONFIG-CONFIG_UFLD_1 = CONFIG_DATA-CONFIG_UFLD_1.
    ZDAMPER_CONFIG-CONFIG_UFLD_2 = CONFIG_DATA-CONFIG_UFLD_2.
    ZDAMPER_CONFIG-CONFIG_UFLD_3 = CONFIG_DATA-CONFIG_UFLD_3.
    ZDAMPER_CONFIG-CONFIG_UFLD_4 = CONFIG_DATA-CONFIG_UFLD_4.
    ZDAMPER_CONFIG-CONFIG_UFLD_5 = CONFIG_DATA-CONFIG_UFLD_5.
    ZDAMPER_CONFIG-CONFIG_VALID = CONFIG_DATA-CONFIG_VALID.
    ZDAMPER_CONFIG-CRT_TS = CONFIG_DATA-CRT_TS.
    ZDAMPER_CONFIG-CRT_USER_ID = CONFIG_DATA-CRT_USER_ID.
    ZDAMPER_CONFIG-PDCT_ID = CONFIG_DATA-PDCT_ID.
    ZDAMPER_CONFIG-PROSPECT_ID = CONFIG_DATA-PROSPECT_ID.
    INSERT ZDAMPER_CONFIG.
    ENDFUNCTION.

    Just declaring the return parameter is not enough. In your example you need to check the return code of the INSERT and populate the message parameter accordingly. Only then you'll get values in there.
    Regards,
    Michael

  • HT201250 Why time machine returns an error message that says "unable to open version"?

    I am using Neat for Mac (a scanner software), but it looks like time machine is not doing the backup for it. Every time I open time machine and I have that application opened time machine shows a message that says "unable to open version". Does anybody know what this mean?
    Thanks

    No, sorry I haven't heard of it.. but there are several softwares around that cause TM issues.
    Is the scanner on the network? Or are you backing up to a USB drive and the scanner is also plugged in by USB.. Expect issues anytime you have an application that is going to take control of the port that TM requires for the backup..
    It might be easy to solve by simply using another device that plugs in differently.. ie FW800 disk instead of USB.. or instead of Time Capsule if it is network issue.
    Or simply buy a different backup software. Since Mavericks.. Time Machine is troublesome.. that is far from the only backup choice.. or even the best one.
    Carbon Copy Cloner is my current favourite.. but others are certainly readily available and doubtless work fine.

  • Starting Photoshop CC/mini bridge is returning an error message

    With Bridge CC open, I select Browse in Mini Bridge and receive the following: "Cannot complete the command because the extension could not be loaded"
    Photoshop CS6 works fine, but this is with Photoshop CC.

    Chris Cox wrote:
    Delete all the folders and plugins that you mistakenly copied from a previous version of Photoshop.
    The Photoshop plugins directory in CS6 and CC is only for third party plugins.
    So, your saying that the `plugins' directory is supposed to be empty on a new install of cc?
    Do you happen to know where mini bridge loads from?  When I have bridge cc running and open a photo in PScc from bridge, then when I hit 'File/Browse in mini bridge', I get a small dialog box telling me the mini-bridge extension is not installed.
    If it were installed, where whould the launch file be?  Can the alleged extension be gotten hold of anywhere?

  • How to get the returned error messages in the Try/Catch block in DS 3.0?

    A customer sent me the following questions when he tried to implement custom error handling in DS 3.0. I could only find the function "smtp_to" can return the last few lines of trace or error log file but this is not what he wants. Does anyone know the answers? Thanks!
    I am trying to implement the Try/Catch for error handling, but I have
    hard time to get the return the msg from DI, so I can write it to out
    custom log table.
    Can you tell me or point me to sample code that can do this, also, can
    you tell me which tables capture these info if I want to query it from
    DI system tables

    Hi Larry,
    In Data Services XI 3.1 (GAd yesterday) we made several enhancements for our Try/Catch blocks. One of them is the additional of functions to get details on the error that was catched :
    - error_message() Returns the error message of the caught exception
    - error_number() Returns the error number of the caught exception
    - error_timestamp() Returns the timestamp of the caught exception.
    - error_context() Returns the context of the caught exception. For example, "|Session Datapreview_job|Dataflow debug_DataFlow|Transform Debug"
    In previous versions, the only thing you could do was in the mail_to function specify the number of lines you want to include from the error_log, which would send the error_log details in the body of the mail.
    Thanks,
    Ben.

Maybe you are looking for

  • How to create a xml file from the jsp page?

    I'm a beginner of the develop xml,my question like this, there has a jsp page,some parameters in it,I wanna get the parameters and create a xml file,so,what parser method should I use? And how to create a new xml file,when the file haven't exist at f

  • MyFaces schedule component is not rendering properly.

    Hello everybody. I am trying to use the Tomahawk schedule component with Jdeveloper 10.1.3.2. It is not rendering properly. The schedule entries and the header line are mising for weeks. I removed the default-render-kit-id element from the faces-conf

  • Computer to tv cable`

    I was wondering if apple or if any knows what type of cord i should buy to connect my white 13 inch macbook to my tv. i need like the exact name of what i want to watch i would prefer it to be something that i can watch whatever is on my computer scr

  • Logic to upload file with dynamic columns

    hi in my requirement i hav given to add logic to upload file with dynamic columns so that this upload program can be reused. this way the program is flexible, irrespective of the number of columns in the file. can any one explain this? and let me kno

  • How to recompile the Intel Solaris kernel

    HI, I installed Intel solaris on x86 system. As per the manual U should change parameters in /etc/system file to configure semaphores and kernel memory . After updating the /etc/system file ,restart is required to take parameters in effect. But even