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:
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)
This is super useful. Would there be an easy way to modify so that the script doesn’t error when it doesn’t find a control listed in the configuration? I have a report that uses conditional blocks, and I get an error when the custom control configuration includes an object/control name that isn’t (yet) rendered.
This is really usefull. I was hoping this would enable being able to select & copy/ctrl-c where interactivity is disabled. Unfortunately it doesn’t 🙁
still trying to find a solution for that. No luck yet unfortunately.
Hi Paul, Is there a way to remove some features from the control? For example, remove chart option or grouping. Thanks!
Unfortunately no, I’ve requested API access to the interactive toolbar but haven’t had any positive response yet. IBM knows a lot of people are asking for this, and they are planning on doing something. Hopefully.