Tuesday 30 September 2014

Creating checkbox in Cognos Report StudioDynamic Selection of Columns in IBM Report Studio

This document shows how to create a report that allows a user to dynamically select columns in Cognos Report Studio report.
Steps:
Create a base report by using GO Sales (Query) package.
Drag and drop the selected query items from the Query subjects.
Note: In Value Prompt Property Change the following Paremeters
Multi-Select - Change : No=>Yes
Select UI   - Change : Listbox => Checkbox Group 
Fig: Base report with columns for Product, Product line, Product type, Product description and Unit cost
Create a prompt page:
1. By using the page explorer  create a prompt page
2. Double click on prompt page1 and insert value prompt from insertable pane.
3. Within the Prompt Wizard dialog box, give the parameter a name and then click Finish.
4. In this example parameter is column selected prompt.
5. In the Properties pane for the Value Prompt under the General category, change the Multi-Select property to Yes and the Select UI property to Check box group.
6. Add static Use and Display values to the Value prompt. Each of these values will be checkbox item on the prompt page.
7. Give the use and Display for the 4 columns.
Making the Query Items Dynamic:
  1. Switch to page1 Double click on the Product  query subject and insert the following calculation:
2. Do the same for the remaining query subject by modifying the column name with corresponding use value from static choices.
3. Now create the render variables to show and hide the columns on the user choice. To do this, click on the Product column then clicking on the List Column ancestor after clicking on the up arrow beside the List Column Body element on the header of the Properties pane.
4. In the Render variable dialog select <New Boolean variable>
5. Then give the variable name as var_product1
6. Edit the expression definition as follows .
7. Do the same for all query items.
8. Run the report and select the required columns from the prompt page.
9. Then you will get only product and product type in the report output.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Method :2

How to select multiple columns from a value prompt in Cognos List report?

Description-: User wants a multiselect prompt where he can select the the columns which he wants to see in the list report in Cognos.
Solution: For simplicity we will use a prompt page and single list with 3 columns. We can have the prompt on Report page with a submit button as well.
1> Make a prompt page. Drag a value prompt on it. Make the property Multiselect = Yes and UI can be Check box group or List Box.
2> Use static choices to make three values. We will same use & display  values i.e Col1, Col2, Col3
List of static choices
Static choices example








3> Then make 3 Boolean variables with syntax Boolean1: ParamValue(‘Parameter1′) contains ‘Col1′ ,  Boolean2: ParamValue(‘Parameter1′)  contains ‘Col2′ & Boolean3: ParamValue(‘Parameter1′) contains ‘Col3′ .( Parameter1 is the name of the parameter which was created when we made the value prompt. As a best practice give names to your parameters in accordance to your business.)
4> Go to your report page. Make list report with columns of your choice.
5> Select First column make sure in properties next to ancestor button  List Column is selected  and not List Column Body.
6>In the properties of List Column under Conditional option go to Render Variable Select Boolean1 for the first column . Repeat the process for the remaining two columns with Boolean2 and Boolean3 .

No comments:

Post a Comment