Cognitive Information

Calling Cognos reports with URL parameters and removing headers

When building dashboards with jQuery objects, there may be issues calling the report within the Cognos Portal Pages ‘Cognos Viewer’ object. The workaround is to use the ‘HTML Viewer’ in a portal page. The HTML Viewer is actually an iFrame calling a new instance of Cognos and may require re-authentication.

The method we ended up for inserting reports is as follows.

1. Create the target report for the dashboard/portal page.

2. In Cognos Connection, navigate to the report and click on Properties.

3. In the upper right hand corner Click on ‘View the search path, ID and URL’.

4. In the pop-up info window, there is a ‘Default action URL’. Copy the contents of that box to a text editor such as Notepad++.

Paste it into your text editor and It will be in this format:

http://localhost:80/cognos84/cgi-bin/cognosisapi.dll?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Samples%27%5d%2ffolder%5b%40name%3d%27Models%27%5d%2ffolder%5b%40name%3d%27Interactive%20Samples%27%5d%2freport%5b%40name%3d%27Top%2010%20Retailers%20for%202005%27%5d&ui.name=Top%2010%20Retailers%20for%202005&run.outputFormat=&run.prompt=true

5. In the text editor
Replace ‘b_action=cognosViewer’
With ‘b_action=xts.run&m=portal/launch.xts&ui.tool=CognosViewer’
(remove single ‘quotes’)

6. To remove headers, append the URL with ‘&ui=h1h2h3h4’
See page 7 of the IBM PDF for details:

Cognos headers

Cognos header labels used for removal.

Completed URL to call report without headers:

http://localhost:80/cognos84/cgi-bin/cognosisapi.dll?b_action=xts.run&m=portal/launch.xts&ui.tool=CognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Samples%27%5d%2ffolder%5b%40name%3d%27Models%27%5d%2ffolder%5b%40name%3d%27Interactive%20Samples%27%5d%2freport%5b%40name%3d%27Top%2010%20Retailers%20for%202005%27%5d&ui.name=Top%2010%20Retailers%20for%202005&run.outputFormat=&run.prompt=true&ui=h1h2h3h4

7. Create a portal page with an ‘HTML Viewer’

8. Open the page and edit the HTML Viewer properties.

9. For the ‘HTML Content’ paste in your completed URL from above.

10. Save and open the portal page. It should run with jQuery working and not replicate the main portal headers.

Tags: , ,

Sorry, the comment form is closed at this time.

Business Intelligence & Data Warehouse Consulting

%d bloggers like this: