Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
Expand all | Collapse all

How to add an item with a link to external web page (11.2.4)?

  • 1.  How to add an item with a link to external web page (11.2.4)?

    Posted Tue September 26, 2023 08:56 AM

    Hello,

    we would like to add/customize an entry in the Cognos portal that contains a link to an external web page that opens in a new web browser tab.

    The entry should be either in the hamburger menu or in the app-bar beside the search area.

    I tried the sample SampleExtensionOpenWebsite_11_2 coming with 11.2.4 and this works, but only with the sample link to IBM web-page and displaying the content inside the Cognos portal (IFrameOpener).
    Using a link to another web-page the error message appears: <web page> has rejected the connection

    Question: Does anyone has an example how to open a web page in a new tab of the web browser by clicking on an item in the hamburger menu or in the app bar?

    Thanks
    Michael



  • 2.  RE: How to add an item with a link to external web page (11.2.4)?
    Best Answer

    Posted Wed September 27, 2023 03:57 AM
    Edited by Michael Haass Wed November 08, 2023 08:42 AM
      |   view attached

    Hi Michael,

    Yes the IframeOpener will open a new window WITHIN the Cognos glass UI. To open a new tab/window OUTSIDE of the Cognos glass UI, you can create an extension with its own JavaScript for a custom actionController (e.g. which uses something like window.open() ). Something like this:

    define([], function() {
        'use strict';

        var MyController = function(){

            this.execute = function(context, parms){
                window.open(parms.options.url);
            }

        };

        return MyController;

    });

    I've attached a small sample extension that does this (you can also use the actionController in an extension where the spec.json adds this as an item in the hamburger menu, if you prefer.) To open your own URL, modify the spec.json in this extension and update this field: 

    "options": {
                    "url": "https://ibm.com",
                    "title": "Website"
                  }

    (As for the error you were getting with the IFrameOpener actionController, there are a couple of possibilities, depending on what specific error you were seeing - e.g.: trying to open an http url in an iframe, when the Cognos page is https, the source page for the url you are embedding returning an HTTP header (e.g. X-Frame-Options) indicating it is not allowed to be put in an iFrame, etc.)



    ------------------------------
    Jim Boland


    LinkedIn: https://www.linkedin.com/in/jimboland

    Website: https://coreinsightz.com
    Email: jimboland@coreinsightz.com
    ------------------------------

    Attachment(s)

    zip
    openExternal.zip   9 KB 1 version