Customizing Cognos URL Objects (Part II)

In part one of our customizing Cognos URL objects article, we discussed how to create a new URL link in Cognos Connection and change its default action to be open in a new re-sizable window to demonstrate one method of extending the existing Cognos capabilities. When developing Cognos professional reports, often times we get similar requests from end users: Can you open the requested page in a new window when a hyperlink is clicked? Unfortunately unlike a drill through link which allows a report author to choose to open the new page in a new window, the default action of the Insertable object hyperlink is always to open in the current web browser window. Now the question becomes how to set a hyperlink to open in new window? Is this even possible? The answer is “Yes” and can be done by following the three easy steps described below:

Development Environment

  • Cognos 8.4.1
  • IE 6.0 or Fire Fox 3.0.5

Step by Step Demo Instructions

  1. Login into Cognos and launch Report Studio, select “create a new List” report template and use the sample Go Sales (query) package.

  2. Drag and drop Product line, Revenue, Quantity query items from Sales (Query) namespace to create a simple list report.

  1. From the Insertable Objects tab, drag a HTML item before the list created in prior step. Type the following code as HTML item source text:

    <a href=”javascript: void(0)” onclick=”window.open(‘https://www.ironsidegroup.com’, ‘mynewwin’, ‘width=450, height=377, resizable=yes,left=100,top=100,screenX=50,screenY=50’); return false;”>My Company Web Site</a>

  1. Save and run the report. You will notice that a hyperlink “My Company Web Site” is shown on report. Click on that hyperlink, a new small window is popped up. In our example the Ironside Group company web page is displayed in this new resizable window.

You have just created an open-in-a-new-window style hyperlink! In next month’s News Letter let’s take a look on how to format the hyperlink in any style you want it to be. For example, you may want to format the hyperlink in a gray color and Arial font style without underline so that it has the same look-and-feel as your organization’s web site.