COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: johnmabe on 11 Sep 2010 04:31:26 PM

Title: Auto Refresh a Report in Cognos Connection
Post by: johnmabe on 11 Sep 2010 04:31:26 PM
Hi,

I have a report that needs to be displayed in Cognos Connection via Cognos Viewer and I need for the report to be auto-refreshed every 5 minutes. How can the report be auto-refreshed without having to constantly click on the refresh button?

Also, the report will have a prompt. Is it possible that the user enters the prompt only once to start the day and the report still auto-refreshed based on the original prompt selected?

Thanks
Title: Re: Auto Refresh a Report in Cognos Connection
Post by: CognosPaul on 13 Sep 2010 07:56:39 AM
IBM has an article on their support page that details how to do it. here (http://www-01.ibm.com/support/docview.wss?uid=swg21342426).

In case the link ever goes dead, here's the Javsacript:

// Licensed Material - Property of IBM
// © Copyright IBM Corp. 2003, 2009
<script type="text/javascript">
var intval;
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if ( !fW || fW == undefined) 
{

      fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );

}
var preFix = "";
if (fW.elements["cv.id"])
{

      preFix = fW.elements["cv.id"].value;

}   
var nameSpace = "oCV" + preFix;
if(intval!="")
{

      self.clearInterval(intval);
      intval="";

}
self["RunReportInterval"] = self.setInterval( nameSpace + ".getRV().RunReport()",300000 );
intval = self["RunReportInterval"];
</script>