i need display cognos reports on display screen , reports need refreshed @ given interval of time.
1) 1 off cognos report had 6 pages in it, , need show 6 pages 1 after other, , should go next report , in same way has display pages in report.
presently using iframe display multiple cognos reports, show stopper unable display pages of cognos report, showing 1st page of report.
script display multiple cognos reports.
<script type="text/javascript"> var slideimages = new array(); slideimages[0] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%201st%20page%27%5d&ui.name=brackenfell%20dc%20-%201st%20page&run.outputformat=&run.prompt=true"; slideimages[1] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20full%20case%20picker%20shift%201%27%5d&ui.name=brackenfell%20dc%20-%20full%20case%20picker%20shift%201&run.outputformat=html&run.prompt=true"; slideimages[2] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20full%20case%20picker%20shift%202%27%5d&ui.name=brackenfell%20dc%20-%20full%20case%20picker%20shift%202&run.outputformat=html&run.prompt=true"; slideimages[3] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20indirect%20shift%27%5d&ui.name=brackenfell%20dc%20-%20indirect%20shift&run.outputformat=html&run.prompt=true"; slideimages[4] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20late%20picks%20scoreboard%27%5d&ui.name=brackenfell%20dc%20-%20late%20picks%20scoreboard&run.outputformat=html&run.prompt=true"; slideimages[5] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20local%20routes%20remaining%20cases%20to%20pick%27%5d&ui.name=brackenfell%20dc%20-%20local%20routes%20remaining%20cases%20to%20pick&run.outputformat=html&run.prompt=true"; slideimages[6] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20local%20routes%20remaining%20letdowns%27%5d&ui.name=brackenfell%20dc%20-%20local%20routes%20remaining%20letdowns&run.outputformat=html&run.prompt=true"; slideimages[7] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20local%20routes%20repicks%20pending%27%5d&ui.name=brackenfell%20dc%20-%20local%20routes%20repicks%20pending&run.outputformat=html&run.prompt=true"; slideimages[8] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20mezzanine%20shift%27%5d&ui.name=brackenfell%20dc%20-%20mezzanine%20shift&run.outputformat=html&run.prompt=true"; slideimages[9] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20section%20and%20report%20group%20summary%27%5d&ui.name=brackenfell%20dc%20-%20section%20and%20report%20group%20summary&run.outputformat=html&run.prompt=true"; slideimages[10] = "http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20tower%20shift%27%5d&ui.name=brackenfell%20dc%20-%20tower%20shift&run.outputformat=html&run.prompt=true"; // style="border: 0; width: 100%; height: 100%" frameborder="0" // style="border: 0; width: 100%; height: 100%" frameborder="0" scrolling="no" onload="resizeiframe(this)" </script> </head>
body { margin: 0; overflow: hidden; }
#iframe1 { height: 100%; left: 0px; position: absolute; top: 0px; width: 100%; } </style> <body> <iframe id="slide" src="" frameborder="0" style="height: 100%; width: 100%; position: absolute;" height="100%" width="100%" ></iframe> <script type="text/javascript"> var step=0 function slideit(){ document.getelementbyid('slide').src = slideimages[step] if (step<slideimages.length-1) step++ else step=0 settimeout("slideit()",20000) } slideit() </script> </body>
can me giving solution.
kind regards, anil r g
this how advance next page via javascript , cognos js api:
var report = cognos.report.getreport('_this_'); report.sendrequest(cognos.report.action.next);
the api provided in cognos bi versions 10.2 , above.
i create function in each of target reports so:
function navigate(action) { var report = cognos.report.getreport('_this_'); report.sendrequest(action); }
then i'd call function main code:
var iframe = document.getelementbyid('slide'); iframe.navigate(cognos.report.action.next);
this advance report in iframe 1 page.
the challenge comes looping through pages. you'd have know how many pages each report had somehow. if reports have fixed, known number of pages no problem. i'd create array of objects store both source , number of pages:
var reports = []; reports.push(new report('http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%201st%20page%27%5d&ui.name=brackenfell%20dc%20-%201st%20page&run.outputformat=&run.prompt=true',4)); reports.push(new report('http://cogdevweb1:80/ibmcognos/cgi-bin/cognosisapi.dll?b_action=cognosviewer&ui.action=run&ui.object=camid(%22dcanalyze%3au%3aa202da3d8b73bb4b954d583834a025a5%22)%2ffolder%5b%40name%3d%27my%20folders%27%5d%2ffolder%5b%40name%3d%27anil%27%5d%2ffolder%5b%40name%3d%27on%20screen%20testing%27%5d%2ffolder%5b%40name%3d%27brackenfell%20schedules%27%5d%2ffolder%5b%40name%3d%27on%20screen%20displays%27%5d%2ffolder%5b%40name%3d%27scoreboard%20schedules%2007%3a00%20-%2019%3a00%27%5d%2freport%5b%40name%3d%27brackenfell%20dc%20-%20full%20case%20picker%20shift%201%27%5d&ui.name=brackenfell%20dc%20-%20full%20case%20picker%20shift%201&run.outputformat=html&run.prompt=true',9)); ... function report (src,pagecount) { this.src = src; this.pagecount = pagecount; this.currentpage = 1; this.advancecount = function () { if (this.currentpage == this.pagecount) { this.currentpage = 1; } else { this.currentpage++; } } }
then, loop through reports array, changing source did before , using currentpage , pagecount of current instance determine how many times advance page. call iframe.navigate(cognos.report.action.next); correct number of times , call advancecount() on report object increment page counter.
for reference, actions can pass navigate() function follows:
cognos.report.action.next cognos.report.action.back cognos.report.action.reprompt cognos.report.action.cancel cognos.report.action.finish
Comments
Post a Comment