QueBIT Blog: JavaScript Modules in Cognos Analytics

Posted by: Mike Zill

May 15, 2018 10:45:00 AM

Using JavaScript in Cognos Analytics has changed since older version of Cognos. In C10, JavaScript could be placed into HTML items within a report. In Cognos Analytics, JavaScript in reports runs through modules (JavaScript will not run if placed in HTML items unless Interactive Mode is turned off). Similarly to creating a website, JavaScript files will now live on their own in a folder and are referenced by the user within a report.

Advantages of this method include reusability, easier debugging, greater predictability of JavaScript functions, as well as extensibility of the CA platform by integrating 3rd party applications (Predictive or Planning Apps, Maps or other Visuals, etc.).

These modules can be used in a report in two ways:

  1. Page Modules – These are JavaScript files that are referenced in the properties of a page. They are used to implement JavaScript functions that will run every time the page is run. Cognos Analytics comes with predefined JavaScript modules that allow report authors to specify at which state of a report page (i.e. loading) JavaScript will run. For example: an author may want all items of a page to fade in during loading of a page utilizing the FadeIn() JQuery function.
  2. Custom Control Modules – These are JavaScript files that are referenced in the properties of a custom control. They are used to implement JavaScript in specific areas of a report, and are often used in conjunction with HTML items. For example: an author may want to toggle between showing and hiding a prompt.

IBM’s JavaScript samples include Full Screen, HTML slider, Events, and Prompt API Buttons. The full list for CA 11.0.10 can be found here:

We at QueBIT have taken a particular interest in JavaScript modules in order to maximize the utility of CA Javascript ModulesCognos Analytics Reports. By analyzing the generated HTML structure of reports in CA, we’ve identified ways to customize and create loading icons, fade-in/out effects, and many more techniques that give reports a greater application feel.

Check out our latest video demonstrating the ability of JavaScript to create custom page buttons, fade in pages, hide the default loader/cancel box and use a custom loader icon.

Topics: Cognos Analytics 11.0.6


Blog Search

Subscribe to Email Updates

Popular Posts

Recent Posts

Follow Me