COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Priya25 on 13 Jan 2017 03:13:26 AM

Title: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: Priya25 on 13 Jan 2017 03:13:26 AM
Hello folks,

I have been trying few options in Cognos 10.2 to disable unchecking of a specific static choice in a value prompt (UI type check box group), but it seems to be not possible without using javascript.

Can anyone let me know if something like this is possible?

My value prompt has static choices (Employee ID, Employee Name, Employee Status, Employee HireDate). I want Employee Name to be always selected as well as restrict/disable to be unchecked by end users so that Employee Name choice is always in the output.

Kind Regards
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: Kiran P on 13 Jan 2017 03:37:57 AM
Hi Priya,

It is not possible in a multi select checkbox prompt without using javascript. If you want to show Employee Name in output by default and indicate that information to user, you may want to add a note on the prompt page, probably above or below the prompt itself.

Thanks,
Kiran
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: BigChris on 13 Jan 2017 03:46:02 AM
Surely you can just remove it from the prompt altogether. You'll need to alter your filter accordingly...
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: Priya25 on 13 Jan 2017 04:36:29 AM
Kiran,
Currently what I have is a multi-select prompt. But can you share with me the javascript for how to do it for a single-select prompt. If it is possible this way, then I will split the prompts into 2 (Employee Name) and (Employee ID, Employee Status, Employee HireDate). And using the javascript would make the first prompt with Employee Name choice as unable to uncheck by anyone.


Chris,
Agree with you, ideal way would have been to remove the Employee Name from the selection choice itself and display a note on the prompt page that Employee Name will appear by default in output, but my end user wants it this as explained in my post :S

Thank you
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: Priya25 on 18 Jan 2017 02:51:31 AM
Hello All,

Can anybody provide me suggestions on this topic?

Kind Regards
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: bdbits on 18 Jan 2017 04:30:08 PM
Leave the name in the prompt if you must, then force it to be included in your filter expression.

Using javascript in this way is bound to break down the road. Sometimes users are just wrong and you have to find a polite way to tell them it is either not possible, or ill-advised to do whatever they requested.
Title: Re: Prevent unchecking of a specific static choice in checkbox group value prompt
Post by: BigChris on 19 Jan 2017 02:07:00 AM
My thoughts exactly. Your filter would probably end up looking something like:

[EmployeeName] in ?YourPrompt? or [EmployeeName] = RequiredName