If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Multi column display in report studio based on selection

Started by babu babu, 07 Dec 2010 05:20:05 PM

Previous topic - Next topic

babu babu

Hi,
I have 3 fields like A,B,C and measure(Revenue).
The user had to select the fields(single select or multi select) based on that it should display in the report.Please give me the solution.

Thanks!
Anand.

sam115

hiii

as far as i understood u have created a list report with 4 fields a,b,c and revenue..and you want to display the field a/c to user selection..in that case you can use style variables to achieve it.
1st create value prompt in the prompt page..give statis choices as a,b,c and revenue for that prompt..now create a string variable and add 4 values(a,b,c and revenue) to it.now go to list report and select list and in the properties pane define style variable as the one u created before.now point to the conditional explorer and select 1st value that is 'a'..and select box type as none for all the other fields except 'a'..then point to conditional explorer to select 2nd value 'b' and select boxtype as none for all the other fields except 'b'..repeat these steps for other two values also..now u can run the report..

babu babu

Hi Thanks for the reply it will work fine for single select but if i want to select more than one column then please give me the solution.

Thanks!
Anand.

Arsenal

sre's solution will work if you make up static choice prompts for each column that needs to be rendered dynamically and then having a boolean variable (one for each column that needs to be rendered dynamically) hide or show the column (all columns will need to be pre added to the report) based on the pramvalue of each parameter from the static choice prompt. The static choice prompts can be in small table columns with headers such as "Show Column A?" to make it user friendly.

Another soluton would be to have one single large static prompt with checkboxes and the Use value set to the exact column name. Next, add in data items to the query (named appropriately so you know which one is for which column) and set the expression to something like IF ('columnname' in ?staticchoiceparameter?) then ('columnname') else ('NA'). So, if you have 10 dynamically rendable columns, you will have 10 data items. Now create boolean variables for each of these data items with the expression set to [data item]='NO'. Now add in these data items to the report body, change the label of the columns if required and for each column, set it's style to the appropriate variable, then select Yes from the conditional explorer and set the box type to None for that column..and so on for each of the columns

You may also be able to use a prompt macro although I can't think of the exact #promptmany expression you'll need...PaulM is the resident expert on that so hopefully he sees this thread and gives the #promptmany solution  ;D

CognosPaul

My ears were burning!

The original thread where I discussed optional columns can be found here.

Since then I've been asked to build a few fairly complex reports based on that.

Open the attached XML in 8.4.

In this report are two different ways of doing this. One through a single checkbox, and another through multiple checkboxes. As a bonus I've included a few JavaScript functions that I've written to control the appearance and behaviour of the checkbox objects.

SoireesMagiques

I already use this approach for a report and it's working perfectly.

But now I would like to know how I can show three different columns, A, B, and C out of A to E by selecting only one checkbox on my prompt page (the actual report will render more columns, but just for the purpose of understanding how I could achieve this I simplified it to only 3 columns).

I've been stuck with this problems for weeks now and would like to resolve this once and for all.

Many thanks,

SoireesMagiques

CognosPaul

You could use exactly the same method - but setting the static value of the checkbox to:

[NS].[Dim].[Field];[NS].[Dim].[Field1];[NS].[Dim].[Field2]

barrysaab

Boy! Cognos getting on to me!!!