Tag Archives: Cognos

Cognos Prompt Numeric Range Validation

Cognos only supports two type of text box prompt validation; required and numbers only. In both cases Cognos evaluates the text input in real-time. If the validation fails, the prompt gets an orange dashed line underneath it and the Finish button is grayed out. The required validation fails if the prompt is empty and the… Read More »

Multi-prompt Validation

In Report Studio, Cognos provides two types of prompt validation: required and numbers-only. The validation options are available in the prompt property page: Required validation checks to see that the prompt in question is not empty. Numbers-only validation checks to see if the contents of the prompt contains only numbers. If either configured validation check… Read More »

Setting Prompt Defaults Dynamically

For most prompt types in Cognos there is a Default property that allows for setting of static prompt defaults. This allows you to put in a specific value in advance and it works as advertised. However, there are many use cases where we want to dynamically set the default values to make the prompt interface… Read More »

JavaScript: Automatic Prompt Variable Creation

An important part of the process of working with the Cognos JavaScript API is creating variables that reference the JavaScript objects that Cognos creates to represent the prompts on the page. It’s via these variables that we manipulate the properties and call the methods on the prompt objects. This post will detail a technique to… Read More »

JavaScript: Running Code Only Once

Every time Cognos refreshes or reprompts a page any custom HTML objects and the JavaScript they contain are reevaluated and run again. There are times you may want a piece of JavaScript code in a Cognos HTML object to only execute one time. For instance, you may be setting initial default values or instantiating objects… Read More »