1 Reply Latest reply on Dec 6, 2013 12:33 PM by Nicolette

    PDF report not picking up values for page items set by dynamic action

    David Sumner-Oracle

      I'm using APEX 4.2.3 on an database.


      I have a page with a select list LOV (P3_CURRICULUM) on which a simple report is based.  The select list displays text and returns a numeric ID.  I want the users to be able to generate a PDF copy of the report with a header that shows the display value from the select list, a text value that is based on a numeric value from an application item, and the date/time when the PDF was generated.  I have three display only items (I will change them to hidden once this works).  The first (P3_CURNAME) is supposed to hold the text display value from (P3_CURRICULUM).  The second (P3_SITENAME) is the text value that corresponds to an application item (F100_SITEID).  The third (P3_DATE) is to hold the sysdate in the format I want to show on the PDF (MON-DD-YYYY HH:MI).  I created a dynamic action on P3_CURRICULUM that fires ONCHANGE.  It has 3 true actions, one for each of the three items above.  Each one has a SQL query to return a single value.  When I select a value from P3_CURRICULUM, I can see the values of the other items update as expected.  However, when I generate the PDF they are not displayed in the header or footer.  I referenced them using the &PAGE_ITEM. format.


      I'm not clear on why the values would display on the page but not get passed through to the PDF.  Any suggestions would be appreciated.

        • 1. Re: PDF report not picking up values for page items set by dynamic action

          David Sumner


          Are the change values submitted to the server before or at the moment of generating the PDF.

          When using a dynamic action of the type "Set value" only the value on the cliënt side is set. And the generation of the PDF uses the value of the page item in session state.


          What you could do is turning the "Set value" actions to execute PL/SQL code in which you set the page items using bind variable notation. And return the value to also set it cliënt side.

          If the page items are only rendered on the page for debug purpose I would only set the page items on the server side. Use the session link in the developer toolbar to see if the value has changed. Don't forget to refresh the session popup every time the dynamic action has run. And I would set the condition of these items to never so they are never generated on the page.


          If you're on apex 4.2 you can set multiple page items with different values using only one "Set value" dynamic action.