COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jatin.popat on 23 Apr 2009 05:35:58 AM

Title: Selection of column , to be displayed in the report, through prompt .
Post by: jatin.popat on 23 Apr 2009 05:35:58 AM
Suppose i am having 6 columns in my report  having names 1,2,3,4,5 and 6.

Now i want only those columns to be displayed in the report which i will be selecting through prompt.

Suppose i select column 1,2 and 3 then only those 3 columns should be displayed in the report.

Can anyone provide me solution for this ....
Thnx in advance
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: jayani on 23 Apr 2009 06:42:20 AM
Yes u can do this by using render variable. :)
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: Kalyan cognoise on 23 Apr 2009 09:16:17 AM
User wants to be as a required prompt.
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: Gopinath on 24 Apr 2009 04:27:52 AM
Create a Boolean Variable for each column based on the prompt value and assign it to Render Variable property of each column.

Say you have 3 columns in your report.
Create 3 Boolean variables like
ParamDisplayValue('Prompt') Contains 'Column1'
ParamDisplayValue('Prompt') Contains 'Column2'
ParamDisplayValue('Prompt') Contains 'Column3'

Assign the variables to Render variable property of appropriate columns.
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: vij on 24 Apr 2009 08:58:56 AM
hi Gopinath
i tried your steps using  with Boolean variable and render variable property But not giving the empty page
might be i am going wrong somewhere,
can u please explain in details ....

best regards,
vj
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: hrk551 on 24 Apr 2009 09:40:44 AM
Hi VIJ,
I am not sure but can you try this once:    Take only paramValue instead of ParamDisplayvalue

Say you have 3 columns in your report.
Create 3 Boolean variables like
ParamValue('Prompt') Contains 'Column1'
ParamValue('Prompt') Contains 'Column2'
ParamValue('Prompt') Contains 'Column3'


let me know if it works

Thank you
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: vij on 27 Apr 2009 02:46:43 AM
Hi hrk551 ,
sorry to say that but this is not working too.  :(


regards,
vij
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: crn.siva on 27 Apr 2009 03:24:17 AM
Hi,

Gopinath Saying correct,

1) create one boolean varibale, in that expression window write like this "ParamDisplayValue('PromptName(OutputColumn)') is null and give the varibale name as 'ColumnExist'.
2) created 6 boolean variables as per your column names.
3) in that each boolean variable "ParamDisplayValue('PromptName') contains '1' for 1 column and create boolean variable for each columns.
4) goto the report studio drag & drop the conditional block beside the list.
5) and select the block and assign Block variable as 'ColumnExist' variable to that conditional block.
6) current block property as 'No' and select the entire list through ancestor button and drag into that entire list into that conditional block.
7) and select the 1 column and in properties pane select the ancestor button inthat select 'ListColumn' and assign render variable as created boolean variable for 1 column. and assign remaning boolean variable through render varible.

I think it is working properly.


Please excuse any grammer mistakes.

Bye
Title: Re: Selection of column , to be displayed in the report, through prompt .
Post by: vij on 27 Apr 2009 07:39:07 AM
Hi all,
i have tried this and it works.............

1. Create new list report.

2. Drag in desired data items into the list.

3. Create prompt page with Value Prompt
Click Finish.

4. Highlight the value prompt to bring up the properties.
5. Click on the ?Static Choices? property.
6. Enter the names of the columns to be rendered dynamically.


7. Click OK.
8. Set the "Multi-Select" property to "Yes"
9. Set the "Select UI" to "Check box group"
10. Click on the "Conditional Explorer"
11. Click on Variables

12. Drag in a Boolean Variable for each of the dynamic columns
13. Rename each variable to correspond with the column name. This is done by changing the name property.

14. In the expression for each variable enter:
"ParamDispplayValue(parameter name) contains A" ,

A = the name of the column


14. Click on the ?Page Explorer?.
15. Select the first dynamic column.

16. Click on the ancestors button and select ?List Column?

17. In the properties pane select the ?Render Variable?

18. Click OK.
19. Repeat for each column.
20. Run the report. You will now be prompted to select which columns to include in your report.


hope it  will help ............

regards,
vij
:)