Oracle APEX report refresh the easy way

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

I’ve seen numerous solutions for partial page refreshes. All using javascript, timers etc.

I just want a report to refresh itself after 5 seconds.

I add this to the region-footer:

<script type="text/javascript">
<!--
setInterval( "$a_report('##REGION_ID#'.substring(1), 1, 7, 7);", 5000);
//-->
</script>

On request of Patrick Wolf (in the remarks below) this also works:

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

<script type="text/javascript">
<!--
  setInterval("jQuery('##REGION_ID#').trigger('apexrefresh');", 5000);
//-->
</script>

No extra javascript functions, no dificult parameters, works for multiple regions..

Essentially it will do a region refresh using the $a_report apex-javascript function only once (after 5 seconds)..

But when the region gets refreshed…. this region-footer gets executed again…. hence: a refresh every 5 seconds.

$a_report takes these parameters:

  1. the region_id that needs to be refreshed. (apex puts an ‘R’ in front of it. the substring(1) removes the ‘R’ again)
  2. the 1st record to show
  3. the last record to show
  4. the number of records to show
  5. sorting

I hope this helps.

15 thoughts on “Oracle APEX report refresh the easy way”

Leave a Reply