Disabling interactivity on a per control basis in Cognos 11

One of the main selling points of the 11.x release has been one of the more frustrating features. There are times where you may want a standard interactive report, but one of the controls should be absolutely static.

Fortunately there’s a (somewhat) easy way to disable the interactivity on any control you want. If you examine the HTML of a report, you’ll see something like this:

lots of lovely HTML to help keep you warm over the cold winter.

See that roid=”i160″? That’s the attribute that tells Cognos the DOM Object is interactive! Simply remove that and the user won’t be able to do anything with it.

Of course it’s easier said than done. There’s no way in Report Studio to tell Cognos NOT to generate a specific attribute. Instead we have to use JavaScript.

The JavaScript itself is fairly easy. We call the control passing the name of the object we want to deinteractivify, and it will find all elements that have the roid attribute. Removing them all in one painless snip.

It’s important to note that this will not work on the 11.1 JavaScript graphs, only on the server rendered one.

The control configuration is designed to accept a single object name, or an array of them. Use

{
    "controlNames": [
        "myList",
        "myGraph"
    ]
}

Report XML: removeInteractivityReport.txt (1513 downloads)
JavaScript: removeInteractivity.js (1593 downloads)