Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  parameter display in browser tab

    Posted Wed March 23, 2022 12:32 PM
    Is there any way to display parameters with the report name in the browser tab?

    ------------------------------
    BILL DONOVAN
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: parameter display in browser tab

    Posted Wed March 23, 2022 02:25 PM
    Hi Bill,

    I believe the ReportName function is read-only. This function works only when the report is run from the portal.

    Best regards,

    ------------------------------
    Patrick Neveu
    Positive Thinking Company
    ------------------------------



  • 3.  RE: parameter display in browser tab

    Posted Wed March 23, 2022 05:24 PM
    Edited by System Admin Fri January 20, 2023 04:08 PM
    You can use JavaScript to change the tab name, but there does appear to be a browser set character limit:

    Because the report is inside an iframe, you'll need to do parent.document.title='new tab name goes here'

    ------------------------------
    Paul Mendelson
    ------------------------------



  • 4.  RE: parameter display in browser tab

    Posted Thu March 24, 2022 07:52 AM
    Thank you Paul,

    Do you have a link on the syntax and where to put a javascript like this in a report?

    ------------------------------
    BILL DONOVAN
    ------------------------------



  • 5.  RE: parameter display in browser tab

    Posted Fri March 25, 2022 09:41 AM
    for interactive mode you would need to write a custom control that does it. 

    Something like:

    define( [], function() {
    "use strict";
    
    function changeTabName(){};
    
    changeTabName.prototype.initialize = function( oControlHost, fnDoneInitializing )
    {
    var o = oControlHost.configuration;
    o = o??{};
    
    parent.document.title=Application.GlassView.cmProperties.defaultName + ' - ' + Application.GetParameterValues().map(x=>(x.name + ' = ' + x.value.map(y=>y.display).join(', ')) ).join (', ')";
    fnDoneInitializing();
    };
    
    return changeTabName;
    });​
    Save that onto the gateway (under webcontents\JS maybe) and then call it with a custom control set to UI Type:none.

    If you're using the premium version of my Cogbox you could use the performActions control and just do:
    {
        "Start on load": true,
        "Actions": [
            {
                "type": "tabName",
                "title": [
                    {
                        "type": "reportName"
                    },
                    " - Year = ",
                    {
                        "type": "parameterDisplay",
                        "name": "Year"
                    }
                ]
            }
        ]
    }​


    It gives you a much finer grain of control there.



    ------------------------------
    Paul Mendelson
    ------------------------------