Friday, January 7, 2011

Automatic partial page refresh in OBI EE - Dashboard

      I had a customer query asking if it possible to refresh a portion of the dashboard automatically once in 3 seconds. The answer is pretty much yes using a java script. I shall blog about that now.

    Lets take the sample report below which we would want to refresh every 3 seconds in the dashboard page. The report should refresh for the corresponding year chosen as the prompt.Lets take the following report for example.

        Based on the year selected, the products and their revenue should be seen. The other requirement is that this report should automatically get refreshed once in every 3 seconds. Inorder to achieve this, first enable the 'Refresh' link to this report by going to 'Edit Dashboard'. Go to the report section and choose 'Report Links' as shown below.

Click on OK and save and Run.The Refresh link will now be available beneath the report in the dashboard. Right click the link and 'Copy Shortcut' to get the link and paste it in a notepad as follows:


On pasting in a notepad, the script should look something like this.

Now, use the above script and write the below java script.

<script>
function  partialRefresh(){
HereLink('d:dashboard~p:iid0novn57ohc76k~r:ou0jgrg1b4vgru0m','Refresh'); } setTimeout( "partialRefresh()", 3000  );
</script>

Edit the report and add a static Text view below the report. In the static text view, paste the above code and check the 'Contains HTML Markup' checkbox as below.
When you save it, it is as follows.



Save the report and the steps are done. Thus only a single report can be automatically refreshed every few seconds.






No comments:

Post a Comment