COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Active Reports => Topic started by: surajr on 18 Nov 2015 10:58:24 AM

Title: Active reports auto refresh
Post by: surajr on 18 Nov 2015 10:58:24 AM
Hello,

Is there a way to get an Active report to auto refresh every 5 minutes or so? I understand that Active reports are meant to be offline views, but in our case we want it to be able to refresh. We had a HTML item that contained a script to do it in the Report STudio view. However, this does not seem to work on the Active Report. ANy advice? Much appreciated.

Added information. We are using Active reports as a dashboard that is used on the shop floor. Based on the changes in source data, the "dashboard" needs to be updated.

Thanks,
Suraj
Title: Re: Active reports auto refresh
Post by: shelby435 on 18 Nov 2015 11:21:17 AM
Just off the top of my head, I assume you already have the reports bursted?

You can set up a job than run every 5 minutes and bursts each time?
Title: Re: Active reports auto refresh
Post by: surajr on 18 Nov 2015 11:32:32 AM
Thanks shelby! Its being displayed on the screen as a dashboard. So i'm not bursting it to anyone. It needs to refresh on the screen automatically.

I used the following script in report studio when I had a non active report, and it worked perfectly when I ran the report as a HTML output. It doesn't work in a active report.

<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(); }, 600000 );
// for Auto Refresh 600000 is a value in milliseconds, ie 10 minutes here.
})(this);
</script>
Title: Re: Active reports auto refresh
Post by: MFGF on 19 Nov 2015 05:49:50 AM
Quote from: surajr on 18 Nov 2015 11:32:32 AM
Thanks shelby! Its being displayed on the screen as a dashboard. So i'm not bursting it to anyone. It needs to refresh on the screen automatically.

I used the following script in report studio when I had a non active report, and it worked perfectly when I ran the report as a HTML output. It doesn't work in a active report.

<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(); }, 600000 );
// for Auto Refresh 600000 is a value in milliseconds, ie 10 minutes here.
})(this);
</script>

Nope - it doesn't work like that. You are displaying a rendered MHT file on your screen, and you can't refresh it once it has been created. You can only create new MHTs - by re-running the report, but this does not sound like your requirement.

MF.
Title: Re: Active reports auto refresh
Post by: surajr on 19 Nov 2015 10:24:43 AM
Thanks MF. Yes. My requirement is to automatically rerun the report and obtain the new MHT on screen. Is there any way around this? I was looking to do this in Cognos WorkSpace but that also does not have an Auto refresh feature. Is a non active report the only way to auto refresh something in IBM Cognos?
Title: Re: Active reports auto refresh
Post by: bdbits on 23 Nov 2015 09:18:44 AM
An Active Report is a bit like saving a PDF from a report. You run it, the output is generated and saved somewhere and can be viewed indefinitely.

If you want a report refreshed every 5 minutes, an Active Report is really not the way to go unless you absolutely have to have some capability an Active Report has that a normal report does not. You might be able to manually build a way to get the content refreshed, but it will most certainly not be out-of-the-box / automatic.