tags:

views:

741

answers:

2

I wanted to put checkbox in my cognos 8 report based on some condition i.e if condition is true checkbox will appear with click mark and if it is not then without click mark. could you please help me ....

+1  A: 

I'm assuming you are placing this control on a prompt page...

It's kind of convoluted, but here's the only way I know how to do it. You can place 2 "Value Prompt" controls on your prompt page, and set the "Required" property to "No" on both. Set the "Parameter" property to be the same for both prompts (i.e., they will apply the same filter criteria on your query). For one of the prompts, set the "Default Selections" property so that your default value will be automatically selected on one of the controls. Also, be sure to set the "Select UI" property to "Check Box Group" (even if you only have one value to be checked) so you get a check box control.

Now that your controls are setup, you need to place them on your prompt page and apply a conditional render variable to both controls (you can look it up in Help if you aren't sure how to do this -- it's simple, but too lengthy to describe here). Basically, when your query condition is true, render the one with the check box clicked, otherwise render the one without. I not sure about the version support for the "Render Variable" property, but it works in version 8.4.

There isn't a way to my knowledge to dynamically select a default value on a prompt by linking it directly to a query -- You have to go through the conditional formatting/rendering approach.

Jamey
A: 

yes i completely agree with jamey this is the only known way to do this.

there is another much difficult way to do it is by writing a java code which pretty much does tha same.

so i suggest you stick with jamey's solution.

as far as the version question comes, the 'render variable' property works the same in all versions of cognos 8 i.e. 8.2, 8.3 and 8.4.

Rahul Kadam