Posts

Set Dynamic Default Prompts Using the New JavaScript Prompt API in IBM Cognos 10.2

Continuing with our Report Studio Cookbook series, today we will look at the new Report Studio JavaScript prompt API available in IBM Cognos 10.2. Since the very first release of the web based Report Studio, report authors have been asked often to use JavaScript in a report to achieve some common web application functionality, such as dynamically show/hide certain objects on page based on a user’s selection or changing a page’s color theme by data values. Ironside has published several articles illustrating how to use JavaScript in Report Studio; however undocumented JavaScript APIs and difficulties in migrating JavaScript after a Cognos upgrade have prevented many report developers from exploring this area. Read more

In the previous JavaScript article, we spent some time learning about JavaScript and web page basics. We completed a couple of simple examples on how to insert JavaScript into an IBM Cognos report in Report Studio. Today let’s continue our journey.

Note:

  • All information and examples are specifically designed for IBM Cognos 10 Report Studio based reports. It is assumed that the reader is familiar with Cognos Report Studio.

 

  • For more information about JavaScript and the HTML language basics please go to http://www.w3schools.com and other available web based tutorials.

 

 

  • Code development environment: IBM Cognos 10.1 FP1 , single server, IE 8

 

5 – Reaching a Prompt Element

Obviously, in order to use JavaScript to modify or manipulate an element on a web page, you first need to reach or find the element you want to edit. As I mentioned in section 3 in the previous article, Cognos prompt pages and report pages are dynamically generated web pages. Prompts placed in Cognos reports are designed to take user inputs and submit requests to a web server. Like many other web pages a <Form> element is embedded on the page in order to accept user’s input. As you can imagine, all prompts elements are tied to this intake form. This allows us to easily access any prompt element once we find the form. Read more

Creating JavaScript solutions in Cognos reports to enhance the out-of-box capabilities of the tool may seem like a daunting task to many Cognos report developers. As a seasoned Cognos developer I can understand this trepidation and it is true that unlike using the Report Studio tool to build professional reports, writing JavaScript code is not for everyone. Despite the difficulty of using APIs and developing JavaScript applications in Report Studio, there is business value in using JavaScript to reverse engineer aspects of the Cognos Viewer in certain circumstances. For instance, embedding a Google map in a report or providing the ability to show and hide particular objects in a report. So the obvious question becomes: How do I write JavaScript code with little or no programming experience? Read on to find out! Read more

There is a growing need to provide more dynamic and interactive reporting for technically savvy consumers that have elevated expectations for how their data should be presented to them. With the arrival of IBM Cognos 8.4 comes Cognos Mashup Services, an API that empowers us to build modern looking and feeling web applications using IBM Cognos Reports as a data source. But what do you do if you want to deliver that sort of functionality within Cognos Viewer? The following presentation describes how you can leverage the powerful open-source JavaScript library jQuery to add dynamic user interface elements to your reports or provide functionality previously unavailable. Demonstrations include dynamically filtered and sortable list reports as well as drill-down enabled Tree Map data visualizations.

Download the presentation for Creating Dynamic IBM Cognos Reports with jQuery

One of the issues with using text box prompts is the possibility of receiving incorrect, misspelled, or non-existent entries. This allows the report to run and return unexpected data. Recognizing this, a user would have to return to the prompt page to re-enter values into the text box prompt. Wouldn’t it be nice if there was a way to automatically validate entries against some specified rules while remaining on the prompt page? Read more