Use apex_application.g_unrecoverable_error := TRUE; and apex_collection.truncate_collection doesn't work

I'm trying to print pdf using JasperReports Integration. I need to do an INSERT then clean all the page items(including the apex_collection.truncate_collection for truncate the collection)  and print with the Jasper call(all in one button).
The Insert works, and i can perfectlly print too, but the clean page items and the truncate collection doesn't.
Please HELP! its really urgent!!
Thnx.
Ricardo Capuz

Hi Nicolette, i'm really new on Apex, sorry for the bad explanation.
First, thank for your answer, my apex version is 4.2.2.
I'm sure that the insert works perfect, cause i checked with the database.
i used apex_application.g_unrecoverable_error := true; because is the code that bring the people of JasperReportsIntegration and I tried to comment it but without it, the print doesn't work.
My problem is when I use the g_unrecoverable_error the printPDF works perfect but apex does not truncate the collection or clean the fields neither.
I have an invoicing application, i want to click on "generate invoice" and do the insert, print pdf and refresh the page, so that when the user finish to print the invoice, the invoicing application is clean for make another invoice.
Here's the code of the print pdf....
DECLARE
           l_blob        BLOB;
           l_mime_type   VARCHAR2 (100 char);
           l_proc varchar2(100) := 'get report as blob, then show';
           l_additional_parameters varchar2(32767);
BEGIN
      l_additional_parameters := 'USUARIO_CODIGO=' || apex_util.url_encode(:APP_USER);
      l_additional_parameters := l_additional_parameters||'&PRESUPUESTO_NUMERO='||apex_util.url_encode(:PRESUPUESTO_ID);
      xlog (l_proc, 'url (orig):' || 'http://Servidor-New:8181/JasperReportsIntegration/report');
   -- generate the report and return in BLOB
  xlib_jasperreports.set_report_url ('http://Servidor-New:8181/JasperReportsIntegration/report');
  xlib_jasperreports.get_report(
                                   p_rep_name => '&JASPER_HOME./PRESUPUESTO_CNO',
                                   p_rep_format => 'pdf',
                                   p_data_source => '&JASPER_HOME.',
                                   p_rep_locale => 'es_ES',
                                   p_additional_params => l_additional_parameters,
                                   p_out_blob            => l_blob,
                                   p_out_mime_type       => l_mime_type
   -- set mime header and filename
   OWA_UTIL.mime_header (ccontent_type      => l_mime_type,
                         bclose_header      => TRUE);
   -- send Content-Disposition and suggest a file name for saving
   htp.p('Content-Disposition: attachment; filename="'|| 'Presupuesto.pdf' ||'"');
   -- set content length
   HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
   OWA_UTIL.http_header_close;
   -- download the file and display in browser
   WPG_DOCLOAD.download_file (l_blob);
   -- release resources
   DBMS_LOB.freetemporary (l_blob);
   -- stop rendering of APEX page
  apex_application.g_unrecoverable_error := TRUE;
/* apex_application.stop_apex_engine;                               -------I PROVE WITH THIS ONE AND IT DOESN'T WORK
   apex_util.redirect_url (                                      --------IF I SET THE BUFFER RESET TO TRUE, IT CLEAN THE FIELDS BUT DON'T PRINT AND IF I SET TO FALSE IT PRINT BUT DON'T CLEAN THE FIELDS.
p_url => 'f?p=&APP_ID.:30:' || :SESSION,
                          p_reset_htp_buffer => true ); */
    -- Limpieza de ITEMS collection
apex_collection.truncate_collection(p_collection_name => 'ITEMS');  -----I TRIED TO PUT THIS PART UPPER THAN THE g_unrecoverable_erro BUT IS THE SAME THING.
:P30_CI:='';
:P30_NOMB_AP_PACIENTE:=' ';
:P30_HISTORIA_PACIENTE:= NULL;
:P30_RIF_RESP_PAGO:=' ';
:P30_NOMBRE_RESP_PAGO:=' ';
EXCEPTION
   WHEN OTHERS
   THEN
      xlog (l_proc, SQLERRM, 'ERROR');
      RAISE;
END;
I really aprecciate your help. Thank you Nicolette!!!
Ricardo Capuz

Similar Messages

  • Using Office 2013 group policy template to define Trusted Locations and Template Locations doesn't work

    User Configuration/Policies/Administrative Templates
    - Using Office 2013 group policy template to define Trusted Locations and Template Locations doesn't work
    Microsoft Word 2013/Word Options/Security/Trust Center/Trusted Locations
    - Allow Trusted Locations on the network: 
    Enabled 
    - Trusted Location #1: 
    Enabled 
    Path:  //server/sharedfoldername   [Edit:  Path:
    \\server\sharedfoldername]
    Date: June 10, 2013
    Description: Trusted Location
    Allow sub folders: Enabled
    The policy appears to apply to the client correctly by adding the following registry key and values:
    HKEY_CURRENT_USER\Software\Policies\Microsoft\office\15.0\word\security\trusted locations\location1
    allowsubfolders: 1
    date: June 10, 2013
    Description: Trusted Location
    Path:  //server/sharedfoldername  [Edit: Path: 
    \\server\sharedfoldername]
    However, when you open Word Options/Trust Centre/Trust Centre Settings…/Trusted Locations
    There are no trusted locations listed under ‘Policy Locations’
    I have tried setting similar settings for setting the Shared Templates folder location and just like the trusted locations policy, the registry keys are created properly in HKEY_CURRENT_USER\Software\Policies however word doesn’t
    seem to recognize these either.
    This used to work flawlessly using the administrative templates for Word 2007 and 2010. Has anyone been able to get these policies to apply successfully, or know why office doesn’t recognize these settings from the Policies registry
    Key?

    This would have been an easy solution to the issue.  Unfortunately it isn't the problem.  This question was originally posted on another Microsoft site and
    was transferred here and when it was transferred the path's changed from the original post: 
    \\server\sharedfodlername to //server/sharedfoldername.  (I will edit the question to show up as it did in the original post) Not sure how that happened.  This
    is still an issue that I haven't been able to get working correctly.
    As it turns out the 'New from Template' interface Word 2013 has developed is very bulky with large thumbnails and is not very customizable nor practical for an office
    that has a large number of templates.   Because I am unsatisfied with the display and performance of the 'New' template chooser I sought after a solution to change the way word creates a document from a template in another thread: 
    http://answers.microsoft.com/en-us/office/forum/office_2013_release-word/how-can-you-change-the-display-of-templates-in/d49194b9-a6b4-4768-8502-7d7b50e9dd65 working through this issue with Jay we were able to develop
    some VB script with handles a very large number of templates in a list view and it works much faster than the built-in Word interface.  The above thread is how I've worked around trying to define a shared template location and I am quite happy with it.

  • My iphone 5 went into search mode and I can't place or receive calls or use the internet but my text messages work. Sprint had me do a master reset and my phone doesn't work at all now I can't get it past the activation. Will I have to pay in store?

    My iphone 5 went into search mode and I can't place or receive calls or use the internet but my text messages work. Sprint had me do a master reset and my phone doesn't work at all now I can't get it past the activation. Will I have to pay for repairs in store because I didnt get the Apple care plan when I purchased it. Sprint said it may be a phone problem not sure if I should take it to Sprint or Apple...I just need my phone

    I'm sorry to learn that you are not able to make/receive calls chelseabee! (ticket number removed) results indicate that there is no issues with the network or account provisioning. Since you have already done a hard reset http://vz.to/1gBkSJc (as per your post), I recommend exploring replacement options. If your phone is within the one year manufacturers' warranty we can provide a Certified Like New replacement http://vz.to/uyYF0o as long as no physical/liquid damage exist. If your phone has sustained physical/water damage and you have insurance, you can submit a claim to the insurance company online at this link http://bit.ly/07CrqPK
    AntonioC_VZW Follow us on Twitter at www.twitter.com/VZWSupport
    >> Edited to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • I have a black iphone 5 and my flash doesn't work it used to work every once in a while but stopped

    I have a black iphone 5 and my flash doesn't work it used to work every once in a while but stopped I went into the camera app and tried to see if it would flash when I took a picture but I saw it light very faintly and hasn't done lot up since. Should I get the led replaced?

    First, try bringing up Control Center by swiping up from the bottom of the home screen.  Turn on the flashlight by tapping the icon in the lower left.  Does the flashlight work?  If not, perhaps you have a hardware issue.
    If it works, check the top of the screen when you open the Camera app to make sure you have the flash on.

  • Hi! I'm using a Macbook Pro, and my photo booth stopped working! I just updated my software yesterday, but it still doesn't work!! The green light does go on though, any suggestions on how to make it work?

    Hi! I'm using a Macbook Pro, and my photo booth stopped working! I just updated my software yesterday, but it still doesn't work!! The green light does go on though, any suggestions on how to make it work?

    In what way is it not working? 
    Please describe in detail all you have attempted to do in order to resolve the issue. 

  • When I talk to Siri she can't hear me and when I try and use my mic on the keyboard it doesn't work. What do I do?

    When I talk to Siri she can't hear me and when I try and use my mic on the keyboard it doesn't work. What do I do?

    Siri seems to not be working for many people right now.  The only thing you can do is wait.

  • Linux. "OverrideGPUValidation=true" (in mms.cfg) doesn't work.

    In advance I am sorry for bad English language. I Russian man, and use the program the translator.
    Linux (32 and 64-bit). NVIDIA GeForce GTX 560 Ti. Proprietary driver. Flash Player 11 ( (32 and 64-bit)).
    "OverrideGPUValidation=true" (in mms.cfg) doesn't work. 
    On YouTube (in "Show video info") it is written "softvare video rendering" 
    How it to correct? Can the option has changed? 
    PS. 
    "EnableLinuxHWVideoDecode=1" works (On YouTube (in "Show video info") it is written "accelerated video decoding"). 
    How to turm on, "accelerated video rendering"?

    UP. How, now, to include "accelerated video rendering" (without it (in Linux) flickers Flash (at least Flash Games))?..

  • On any page that I have to log in Firefox stops responding and has to shut down. I've tried resetting it and it still doesn't work.

    I've been having this problem for a while now and I can't seem to fix it. Any time I log into any page, Firefox says not responding and I have to restart it. I have to run all of firefox in safe mode if I log out of my email or facebook. I've tried resetting FF and it still doesn't work.

    ''' "I have to run all of firefox in safe mode if I log out of my email or facebook. " '''
    Please explain what you mean by '''all of firefox'''. You're either running in the Firefox SafeMode or you're not. There's no "all" or partial SafeMode.
    Please see this: https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode

  • Help - Font Book and font Library doesn't work

    I've just updated to a new iMac on Yosemite, and Font Book doesn't work. Neither does putting fonts into the "Library"
    There is a range of fonts that ARE working that are already in either place, but some (that worked up until two days ago in my old Mac running OS 10.6.8) just won't work.
    If I select the fonts in Font Book, Font Book doesn't load them. If I put them in the Library, they don't appear for use in any application.
    As a designer, updating fonts is essential, and if this can't be fixed I'm in serious trouble! So any advice welcome!

    We see posts like this here all the time. A person upgrades to a new OS, and Font Book suddenly stops working. Usually, the problem is that Font Book's database has been trashed by the upgrade with the very common symptoms you're seeing. You suddenly can't add fonts, and fonts Font Book says are open don't appear in some, or any apps.
    Restart your Mac and immediately hold down the Shift key when you hear the startup chime to boot into Safe Mode. Keep holding the Shift key until you see a progress bar towards the bottom of the screen. You can let go of the Shift key at that point. Yosemite is a bit different. Whether it's a Safe Mode boot or a normal one, you get the same progress bar. It just takes longer to get to the desktop in Safe Mode. So hold the Shift key until you get to the desktop.
    OS X asks you to log in (you will get this screen on a Safe Mode boot even if your Mac is set to automatically log in). Let the Mac finish booting to the desktop and then restart normally. This will clear Font Book's database and the cache files of the user account you logged into in Safe Mode.
    If that alone doesn't do it (it should), then clear out all of the font cache data.
    Close all running applications. From an administrator account, open the Terminal app and enter the following command. You can also copy/paste it from here into the Terminal window:
    sudo atsutil databases -remove
    Terminal will then ask for your admin password. As you type, it will not show anything, so be sure to enter it correctly.
    This removes all font cache files. Both for the system and the current logged in user account. After running the command, close Terminal and immediately restart your Mac.

  • I am trying to sign in to attend a session and it says 'Invalid user or password. Please try again.' I have reset my password and it still doesn't work. I created a new AdobeID and it still doesn't work. I need to attend this training. How can I get in?

    I am trying to sign in to attend a session and it says 'Invalid user or password. Please try again.' I have reset my password and it still doesn't work. I created a new AdobeID and it still doesn't work. I need to attend this training. How can I get in?

    Sorry to hear about this problem. What site are you trying to log in on? Is it a Mozilla site? Usually you don't need to register or sign in to a Mozilla site to use Firefox. Usually you can just go straight to where you want to go.

  • I clicked "yes" to upgrade iTunes and now it doesn't work. I get an error message stating my computer is missing MSVCR80 and then a message stating Error 7 (Windows Error 126). I've tried reloading iTunes twice. What can I do?

    I clicked "yes" to upgrade iTunes and now it doesn't work. I get an error message stating my computer is missing MSVCR80 and then a message stating Error 7 (Windows Error 126). I've tried reloading iTunes twice. What can I do?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Jdev11g CPU profile and Memory Profile doesn't work for Mac

    I'm running Jdev11g on Mac OSX 10.5.5,
    CPU Profile and Memory Profile doesn't work. I got following message:
    Error occurred during initialization of VM
    Could not find agent library in absolute path: /Shared/jdevjavabase11110/jdeveloper/jdev/lib/profiler16.so
    The file actually is there. I don't understand why they looking for .so file, it supposed to be mapped as .jnilib on Mac.
    This is broken on TP4 as well.

    I'm still seeing this issue. Here is what I get:
    /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -client "-agentpath:/Users/kamleshnanda/Downloads/jdeveloper/jdev/lib/profiler16.so=port=60950,jarpath=/Users/kamleshnanda/Downloads/jdeveloper/jdev/lib/profiler-agent.jar,enable=t,depth=1000,startup=connect,time" -classpath /Users/kamleshnanda/jdeveloper/mywork/MyJavaApplication/Project1/classes project1.Class1 Hello
    Error occurred during initialization of VM
    Could not find agent library in absolute path: /Users/kamleshnanda/Downloads/jdeveloper/jdev/lib/profiler16.so
    Process exited with exit code 1.
    I'm using the following build:
    About
    Oracle JDeveloper 11g Release 1 11.1.1.2.0
    Java Edition Version 11.1.1.2.0
    Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    Copyright © 1997, 2009 Oracle and/or its affiliates. All rights reserved.
    IDE Version: 11.1.1.2.36.55.36
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.2.36.55.36
    Version
    Component     Version
    =========     =======
    CVS Version (External)     (CVS) 1.12.13 (client/server)
    Java(TM) Platform     1.6.0_17
    Oracle IDE     11.1.1.2.36.55.36
    PMD     JDeveloper Extension 4.2.5.3.0
    Team Productivity Center     11.1.1.2.36.55.36
    Versioning Support     11.1.1.2.36.55.36
    Here are the JVM properties:
    java.runtime.name     Java(TM) SE Runtime Environment
    java.runtime.version     1.6.0_17-b04-248-10M3025
    java.specification.name     Java Platform API Specification
    java.specification.vendor     Sun Microsystems Inc.
    java.specification.version     1.6
    java.vendor     Apple Inc.
    java.vendor.url     http://www.apple.com/
    java.vendor.url.bug     http://bugreport.apple.com/
    java.version     1.6.0_17
    java.vm.info     mixed mode
    java.vm.name     Java HotSpot(TM) 64-Bit Server VM
    java.vm.specification.name     Java Virtual Machine Specification
    java.vm.specification.vendor     Sun Microsystems Inc.
    java.vm.specification.version     1.0
    java.vm.vendor     Apple Inc.
    java.vm.version     14.3-b01-101
    Here is the OS information:
    os.arch     x86_64
    os.name     Mac OS X
    os.version     10.6.2

  • TS1363 i need to sync my iphone as its damaged ( water submersion) i can't though as itunes is asking me for my passcode and my screen doesn't work, the phones on though still ringing etc ... Please help

    I need to sync my iphone as its damaged ( water submersion) i can't though as itunes is asking me for my passcode and my screen doesn't work, the phones on though still ringing etc ... Please help

    You need to do more research before you make purchases like this. You've wasted your money. The ONLY officially unlocked iPhone model sold in the US is the GSM model, and that model is only sold by Apple. That's the model iPhone you should have purchased.
    Did you read & understand my initial post? Especially this part:
    The unlocking of the GSM portion is just for International travel in order to use local sims. You still have to pay Sprint for the use of their international GSM partner’s network on a “pay as you go basis”.

  • I have downloaded my latest flash player and it still doesn't work, why?

    I have downloaded my latest flash player and it still doesn't work, why?

    Lightroom doesn't use the Camera Raw plug-in. All of the Camera Raw technology is part of the Lightroom program. You will either have to upgrade to Lightroom 5 or use the DNG converter to create digital negative copies that can be used with Lightroom 4.

  • When i open iTunes U it comes up with just the brown bookshelf but no icons to click on and then it closes. I've deleted it and then re-download it and it still doesn't work.

    On the bookshelf there's no icons to click on and after a mintue it closes. I've deleted it and then re-download it and it still doesn't work. Im using a ipod touch 4 and im on 5.1.

    I, too, am having this problem and it's annoying.  The app just shuts down every time I use it. Too bad cuz it looks lie there are so many wonderful courses in the catalog.
    Any tips on how to fix this would be appreciated!
    Thanks.

Maybe you are looking for