Oracle Apex 5.0: Wait to generate IR until criteria fields entered
<p>I have an APEX 5.0.3.00.03 page with dozens of criteria fields, followed by a region containing an Interactive Report (IR).  I want to defer the IR being produced until a "Generate" button is clicked, but I am having troubles.  The report without criteria would generate millions of rows, via a nasty 5 table join, so I want to defer it processing until the user is ready.  I know that I can do a <code>/*+ FIRST_ROWS */</code> hint, but still want to avoid invoking the SQL until the user picks some criteria.</p>

<p>I tried the following:  </p>

<p>Created a Hidden Field P210_WAIT, initial value of 'TRUE', which I included in the SQL criteria like this:</p>

<pre class="lang-sql prettyprint-override"><code>select * from tab_1, tab_2, tab_3, tab_4, tab_5
where :P210_WAIT != 'TRUE' 
and  -- join, and dozens of other criteria here
</code></pre>

<p>and in a dynamic action on the Generate button, I do two things:</p>

<ol>
<li>Execupte PL/SQL Code to set <code>:P210_WAIT := 'FALSE';</code></li>
<li>Refresh Action:  

<ul>
<li>Action: Refresh </li>
<li>Affected elements: Selection Type: Region.  Region: (region containing my IR)</li>
</ul></li>
</ol>

<p>I have debug statements in the PL/SQL code, and they  are appearing, but the SQL to produce the report is not being run, implying that the Refresh Action is not "waking up" the IR.</p>

<p>It does appear the IR SQL is being executed on page load, as I was dynamically setting the IR Attribute "When No Data Found" value to initially say "Please select criteria and click the <kbd>Generate</kbd> button to display report" and that was working.</p>