You are on page 1of 3

Understanding the Use of Render Variable and Static Choices in Report Studio (Displaying number of pages one at a time

from report based on user selection in report studio) Example1: 1. Create three report list reports in different page (page1, page2, page3) 2. Solution dynamically display report based on user selecting prompt in value prompt 3. Set prompt properties UI= radio button group 5. Click on prompt property: static choices and create two choices by clicking on add button: use=page1, display=page1, use=page2, display=page2, use=page3, display=page3 6. Click on the query explorer and click on the Query 1 of page1 7. Add data items to the query and name them 'page1' 6. Click on the query explorer and click on the Query 2 of page2 7. Add data items to the query and name them 'page2' 6. Click on the query explorer and click on the Query 2 of page2 7. Add data items to the query and name them 'page2' 8. Type in the data item expression for page1; if ('page1' in? Parameter1?) Then ('Yes') else ('No') 8. Type in the data item expression for page2; if ('page2' in? Parameter1?) Then ('Yes') else ('No') 8. Type in the data item expression for page3; if ('page3' in? Parameter1?) Then ('Yes') else ('No') 12. Click on the conditional explorer and create three Boolean variables: 'page1' and 'page2' and 'page3' 13. Drag 'page1' and 'page2' and 'page3' data item in the report expression for 'page1' and 'page2' and 'page3' Boolean variable respectively and type "='Yes' "; Final expression for 'page1' Boolean variable will be [Query1].[page1]='Yes' And for 'page2' Boolean variable will be [Query2].[page2]='Yes' And for 'page3' Boolean variable will be [Query3].[page3]='Yes' 14. Click on the Report pages explorer and select the page1 and click on the property -> property and select the 'page1'; do same for 'page2' and 'page3' 15. Select the 'page1' click on the property: Render Variable and choose from drop down variable list 'page1'; do same for 'page2' and 'page3' 16. Save the report and run it.

Understanding the Use of Render Variable and Static Choices in Report Studio Example2: 1. Create a simple list of some columns: list has ORDER_NUMBER','PRODUCT_NAME','QUANTITY','UNIT_PRICE', 'GROSS_PROFIT' 2. This solution will dynamically render the 'QUANTITY' and 'UNIT_PRICE' columns by selecting and unselecting these columns in value prompt 3. Create a prompt page with value prompt 4. Set prompt properties; multi select= yes and UI= checkbox group 5. Click on prompt property: static choices and create two choices by clicking on add button: use=quantity, display=quantity, 2. use=price, display=price 7. Click on the query explorer and click on the Query 1 8. Add two data items to the query and name them 'quantity' and 'price' 9. Type in the data item expression for quantity; if ('quantity' in? Parameter1?) Then ('Yes') else ('No') 10. Type in the data item expression for 'price' if ('price' in? Parameter1?) Then ('Yes') else ('No') 11. 'Price' and 'quantity' are the static choices and 'Parameter1' is parameter for value prompt 12. Click on the conditional explorer and create two Boolean variables: 'quantity' and 'price' 13. Drag 'quantity' and 'price' data item in the report expression for 'quantity' and price' Boolean variable respectively and type "='Yes' "; Final expression for 'quantity' Boolean variable will be [Query1].[quantity]='Yes' And for 'price' Boolean variable will be [Query1].[price]='Yes' 14. Click on the page explorer and select the whole list and click on the property -> 'property' and select the 'quantity' and 'price' data items 15. Select the list column 'QUANTITY', click on the property: Render Variable and choose from drop down variable list 'quantity'; do the same for 'UNIT_PRICE' list columns and choose Render Variable 'price' 16. Save the report and run it. -----------------------------------------------------------------

Here are the steps, based upon a report built against the Cognos sample data: 1. Create Page 1 and Page 2 for your report. 2. Create the prompt page with Prompt 1 and Prompt 2. 3. Create a BOOLEAN variable with the following expression: ParamDisplayValue('Parameter1') IS NOT NULL. Name the expression "Parameter1 is not NULL"

4. Create another BOOLEAN variable with the following expression: ParamDisplayValue('Parameter2') IS NOT NULL. Name the expression "Parameter2 is not NULL" 5. Select "Page1" from the Page Explorer in Report Studio. 6. Click the Page Body and then click the Ancestor Button to display parent objects for the Page Body. 7. Select "Page" from the local menu that appears when you select the Ancestor button. The properties for the Page object will appear in the Properties pane. 8. Click the "Render Variable" property and select the "Parameter1 is not NULL" variable from the drop-down list. This will allow Page1 to be rendered whenever the prompt value for Parameter1 is not NULL. 9. Select "Page2" from the Page Explorer in Report Studio. 10. Click the Page Body and then click the Ancestor Button to display parent objects for the Page Body. 11. Select "Page" from the local menu that appears when you select the Ancestor button. The properties for the Page object will appear in the Properties pane. 12. Click the "Render Variable" property and select the "Parameter2 is not NULL" variable from the drop-down list. This will allow Page2 to be rendered whenever the prompt value for Parameter2 is not NULL. In this scenario, when one or more values for Parameter1 are selected, Page1 will appear in the report output. If one or more values for Parameter2 are selected, Page2 will appear in the report output. If the user selects values in both parameters, both Page1 and Page2 will be rendered in the output. I hope this is what you were looking for. Jason

You might also like