COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: krishdw85 on 27 Mar 2015 04:40:15 AM

Title: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 04:40:15 AM
Hi Cognos Guru's,
Need some urgent help in dng POC.
In Cognos 10.1 , we have a 2 page 2 report, inside every page we have 2 reports.
so i created a value prompt with static choices page1_A,page1_B,page2_B,page2_B (Multi select), and created 4 render variables with contains. Based of user selection report is picking as expected.
But when user selects only page 2 values , i want to hide complete page1...similalry if he selects page 1 page 2 should nt displayed.
Here when i select only page2 reports , still i see page1 as blank.

How to hide it. Pl help as it is very urgent.
Title: Re: Hide\Show Report
Post by: BigChris on 27 Mar 2015 05:07:49 AM
Apply the render variable to the entire page
Title: Re: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 05:32:24 AM
Thx for quick reply.yep i tried......but no luck.

I selected only page values in prompt page then the report is complete blank.

for each report to be selected: created one per each rebder variable.
ex: ParamDisplayValue('Selected') contains '1'

And final when only page1 objects created below boolen vraible did nt worked yet.
case
when ParamDisplayValue('Selected') in ('1','2') then 'page1'
when ParamDisplayValue('Selected') in ('3','4') then 'page2'
end
Title: Re: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 05:57:36 AM
if it is single selection through string variable it will work, but sometimes user will select multiple also from the single page then it is not working.
Attached XML
Title: Re: Hide\Show Report
Post by: BigChris on 27 Mar 2015 07:09:52 AM
Just a thought, but I'd be tempted to change your code to

case
when ParamDisplayValue('Selected') contains '1' or  ParamDisplayValue('Selected') contains '2' then 'page1'
when ParamDisplayValue('Selected') contains '3' or  ParamDisplayValue('Selected') contains '4' then 'page2'
end


worth a try anyway...
Title: Re: Hide\Show Report
Post by: Joker on 27 Mar 2015 07:53:21 AM
Hi,

Create three variables(Two boolean(Or 1 string variable) for rendering pages and one String for rendering 4 objects in two pages).

In boolean variables use expression

ParamValue('Parameter1') like 'Page1%'
ParamValue('Parameter1') like 'Page2%'

In string variable Use expression
Case
when ParamDisplayValue('Parameter1')='Page1_Crosstab' then 'Page1_Crosstab'
when ParamDisplayValue('Parameter1')='Page1_Chart' then 'Page1_Chart'
when ParamDisplayValue('Parameter1')='Page2_List' then 'Page2_List'
when ParamDisplayValue('Parameter1')='Page2_Chart' then 'Page2_Chart'
end

Associate the string variable values to render Objects.
Associate boolean variables(Or String variable) to render pages.

Thanks,

Regards,
Joker
Title: Re: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 08:48:14 AM
Hi Joker, Thx for quick reply. Can you send your xml if possible.

Through string varaible we can display only single value, but my requirement is for multiple selctions, so the above string will not work.
Can you please explain more.

sometimes, user may select 2,3,4 also ( i mean in page1 one object and page2 two-objects, so at that time, it i snot picking as expected)
Title: Re: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 08:59:21 AM
BigChris: Very big Thank you.
When i select only pagewise values it is displaying perfect, but when i select 2,3 & 4 it is displaying only 2 not able to see 3 & 4.
Title: Re: Hide\Show Report
Post by: BigChris on 27 Mar 2015 09:08:04 AM
I've just reread your original question and it might be that we're talking at cross purposes...can you explain what you mean by "we have a 2 page 2 report, inside every page we have 2 reports"? It sounds a bit like you're creating some sort of report booklet (if that's the right term)...I'm using 10.2.0 so I haven't had any experience of them.
Title: Re: Hide\Show Report
Post by: krishdw85 on 27 Mar 2015 09:30:21 AM
Sorry for confusing, let me explain one more time.
I have a 2 pages report, in every page i have one list (1) & one chart (2)...similalry in page 2 i have 3 & 4.

Multiple selection of Prompt page:
1
2
3
4
Display All

User may select 1,2,3 or 1,2 or 3,4 (any of his choice). so with static choice & bollen variable...i am able to do it. (pl see xml attached above)
But...... when user selects only 1,2 still he is able to see pagedown option and ofcourse page2 was blank........ i dnt want to see page2 at all.
Let me know if any questions.

Regards,
Sai

Title: Re: Hide\Show Report
Post by: BigChris on 27 Mar 2015 09:42:21 AM
Ok - in that case I think what we've suggested so far should work.

Create a boolean variable called DisplayPage1. Set the expression to be something along the lines of:

ParamDisplayValue('Selected') contains '1' or  ParamDisplayValue('Selected') contains '2'

Associate DisplayPage1 with the first page of your report as the render variable for the page

Create a second boolean variable called DisplayPage2.
ParamDisplayValue('Selected') contains '3' or  ParamDisplayValue('Selected') contains '4'

Associate DisplayPage2 with the second page of your report as the render variable for the page
Title: Re: Hide\Show Report
Post by: krishdw85 on 30 Mar 2015 04:25:13 AM
@BigChris: Thank you very much appreciate for your help!
It is working fine.

Thx again!!