Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 


#Product
#Analytics
#CognosAnalytics
#Analyticstools
#TechXchange Partner
#TechXchange Session
#TechXchange Presenter
#AI
 View Only
  • 1.  Automatic Refresh Dashboard In Cognos Analytics

    This message was posted by a user wishing to remain anonymous
    Posted 02/19/19 06:26 AM
    This message was posted by a user wishing to remain anonymous

    Hi Gurus,

    I am aware in Cognos Analytics we have a property to automatically refresh Dashboards. However, do we have similar functionality for HTML reports authored using the 'Author' environment? I wish to refresh the report automatically every x seconds.

    I have attempted to use the following java script within an HTML item without success.

    Many thanks!

    Java Script:

    <script>
    (function(global){

    var ocr = cognos.Report.getReport("_THIS_");
    function sendPRMT_Request(eAction) {
    ocr.sendRequest(eAction);
    }
    function sendFinishRequest() {
    sendPRMT_Request(cognos.Report.Action.FINISH);
    }
    // This is the timeinterval
    global.setInterval( function() { sendFinishRequest(); }, 5000 );
    // for Auto Refresh 5000 is a value in milliseconds, ie 5 seconds here.
    })(this);
    </script>
    #CognosAnalyticswithWatson


  • 2.  RE: Automatic Refresh Dashboard In Cognos Analytics

    Posted 02/20/19 04:43 AM
    Hi,

    This has worked for me in a Cognos 10 environment and may be worth trying.  Copy and Paste the code below into an HTML item.  Adjust the interval time by changing the "RunReport()",'100000' );" parameter (currently set to 100000 milliseconds (100 seconds))

    Kind regards,

    Kirk


    <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()",'100000' );
    intval = self["RunReportInterval"];
    </script>' ​​

    ------------------------------
    Kirk Lothian
    ------------------------------