COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kvca11 on 09 Feb 2018 01:48:43 AM

Title: Hide/Un hide based on prompt selection in report page
Post by: kvca11 on 09 Feb 2018 01:48:43 AM
Hi All,

I have 3 prompts in prompt page and based on the prompt selection drillthrough report will be enabled.

here is the details

By default in first prompt we are dipsplaying "All" and drill through will not be enable,this is fine
for Second prompt cascading is first prompt and here suppose if we have null then automatically drill need to be enable,suppose if  we have values in prompt2 then if we select anyvalu then that time time also drill throuh need to be enable

I tried the javascript and its not working
Any ideas?

Regards,
kvca11
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 09 Feb 2018 04:31:38 AM
You can create a copy of the same object(list/crosstab/chart or whatever) and render it using a variable. The variable expression should be written to render the object only when the parameter value is all. Then set Drill through for only one object(i.e the object which is rendered for values except 'All')

Hope this works!
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: kvca11 on 09 Feb 2018 05:00:45 AM
Hi Danielwilstone

Thanks for reply

I have tried the same but here the problem is if prompt is having Blank then that time also drill through shpuld be enable,this is not happening in this case

Thanks
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 09 Feb 2018 06:26:24 AM
By blank do you mean the value is 'Blank' or no value is selected? If no value is selected, then it will automatically take all the values if it is a multi select. Also I want to know whether the prompt is an optional or required one?
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 09 Feb 2018 06:33:53 AM
Quote from: danielwinston on 09 Feb 2018 04:31:38 AM
You can create a copy of the same object(list/crosstab/chart or whatever) and render it using a variable. The variable expression should be written to render the object only when the parameter value is all. Then set Drill through for only one object(i.e the object which is rendered for values except 'All')

Hope this works!

And by this logic the drill through should work because we are just checking if the value of the parameter is All. If it is a boolean variable that you are using, Yes will hold true whenever the parameter is All and No will hold true whenever there is any value except 'All' which includes NULL. I shall be able to suggest you better if you could post some screenshots.
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: kvca11 on 09 Feb 2018 07:12:45 AM
Hi danielwinston

Thanks for reply,


Blank is showing in second prompt(pls find the attached screenshot),If is is (Blank) then drill wil be enable
Prompt is optional and for prompt2 cascading source is propmt1

Thanks
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 09 Feb 2018 08:01:53 AM
I assume prompt 2 is a single select seeing the screenshot. And I assume (blank) is also one of the values in the data item that the value prompt is pointing to. If yes, then Pointing 'All' to yes and other values to No should work fine because 'Blank' will also be considered as a value.

If not, and (blank) is a null value, Use a case statement as variable expression in this case. For Yes, point to All and for No, point to (blank) and other values.
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 09 Feb 2018 08:12:12 AM
"ParamDisplayValue('Paramname') is null" should be the expression. In case (blank) is selected, the expression becomes not null. Render the object without drill through to 'Yes' and render the object with drill through to 'No' using either Render Variable or Conditional Block.
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: kvca11 on 09 Feb 2018 10:59:35 PM
Hi Danielwinston,

Thanks for reply .

Prompt 2 is a single select and currently with the condition of paramdisplayvalue(paramvalue) is the condition then if we select the blank in second prompt then only drill through is enabling  but as per the req,If Blank(null converted to blank and considering as a value) is present in second prompt then drill through will be enable automatically without selecting Blank

regards,
Title: Re: Hide/Un hide based on prompt selection in report page
Post by: danielwinston on 12 Feb 2018 12:22:38 AM
Try equating the value of the data item to 'Blank' in addition to the existing expression with the help of an AND. Suppose dataitem1 is the data item that you are pointing to the prompt, add the same to the expression.