Prompt API - Auto refresh a report with a time interval

Technote (FAQ)


Question

How can we autorefresh a report in IBM Cognos Prompt API with a time interval ?
It needs to work in the interfaces of Cognos Connection, the Portal Portlets and the Cognos Workspace.

Answer

NOTE : Any previous documentation using unsupported Javascript in the older versions before C10.2.x for refreshing a report in a timed manner, are obsolete for this version.

This Javascript code is based on the Prompt API and is supported in IBM Cognos 10.2.x and later versions only.

Include the following JavaScript code in the HTML item in the report, it will automatically refresh the report for the defined interval.

<script>
(function(global){

var ocr = cognos.Report.getReport("_THIS_");
function sendPRMT_Request(eAction) {
ocr.sendRequest(eAction);
}
function sendFinishRequest() {
sendPRMT_Request(cognos.Report.Action.FINISH);
}

global.setInterval( function() { sendFinishRequest(); }, 5000 ); // for Auto Refresh
})(this);
</script>


Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Cognos Business Intelligence
Software Development Kit

Software version:

10.2, 10.2.1

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Software edition:

Edition Independent

Reference #:

1646893

Modified date:

2013-08-16

Translate my page

Machine Translation

Content navigation