Add Conditional Rendering - Cognos 8


Add Conditional Rendering  

Add conditional rendering to specify which objects are rendered when a report is run. This is useful when your report contains sensitive data.
Conditional rendering is not the same as showing or hiding objects. When you hide an object, the object exists but is transparent. If an object is not rendered, it is not in the report.
For a list of objects that can be rendered conditionally, see the Render Variable property in "CONREF to ?ti_rptstd_ref_propnew_NOTGENERATED.xml#report_studio_object_and_prop_ref? To open after import, click ->" .

Steps

1.Select the list column to be rendered conditionally.
Tip: You must select the list column, not list column body or list column title. If the body or title is selected, as indicated in the Properties pane, use the select ancestor buttonrs_sel_par.gif to select the list column.
2.In the Properties pane, double-click the Render Variable property.
3.Click Variable and click the variable that will be used to determine if the column is to be rendered.
4.In the Render for box, select the values you want the condition to support and click OK.
Tip: A default value exists for the variable, and it is always selected.

Example - Create a Conditional Report  

You are a report author at The Great Outdoors Company, which sells sporting equipment. You are requested to create a report that shows orders after a date specified by the user. The report will prompt the user for a date, and will also ask whether the user wants to see a description for each order.

Steps

1.In the Cognos Connection Welcome page, click the Public Folders link.
2.Click the GO Sales and Retailers link, and then click the Report Studio link in the upper-right corner of the page.
3.In the Welcome dialog box, click Create a new report or template.
4.In the New dialog box, click List and click OK.
5.In the Insertable Objects pane, on the source tab, add the following data items to the list by double-clicking them:
    • Order date
    • Order number
    • Product name
    • Description
    • Quantity
    • Unit sale price
    • Revenue
Tip: You can find these data items in the Products and Orders folders.
6.Click Order Date and click the section button.
7.Group the Order Number column by selecting the column and clicking the group button.
8.Click Revenue, click the aggregate button, and click Total.
9.Change the title of the report to New Orders.
10. Pause the pointer over the page explorer button and select Prompt Pages.
11. Create a new prompt page by double-clicking Pages in the Insertable Objects pane.
12. Double-click the new prompt page.
13. In the Insertable Objects pane, on the toolbox tab, double-click Text Item and type the following text:
Enter the start date, and select if descriptions will be shown.
14. Insert a 2 by 2 table into the prompt page using the insert table button, and moving the pointer until four squares are highlighted in a 2 by 2 pattern.
15. In the Insertable Objects pane, on the toolbox tab, drag Text Item into the upper-left cell and type the following text:
Starting Date
16. In the Insertable Objects pane, drag a Text Item into the lower-left cell, and type the following text:
Show Descriptions
17. In the Insertable Objects pane, drag a Date Prompt into the upper-right cell.
18. When prompted with the Prompt Wizard, Choose a Parameter window, select Create a new parameter and type p_Date in the space provided, then click Next.
19. When prompted in the Create Filter window, select Create a parameterized filter with the following entries:
o For Package item, click the ellipsis points (...) and click [gosales_goretailers].[Orders].[Order date].
o For Operator, click >.
20. Click Finish.
21. In the Insertable Objects pane, drag a Value Prompt into the lower-right cell.
22. When prompted with the Prompt Wizard, Choose a Parameter window, select Create a new parameter and type p_ShowDescn in the space provided, and then click Finish.
23. Select the Value Prompt, and in the Properties pane, double-click Static Choices.
24. Click Variable, click , and when prompted, type the name showDesc.
25. Click the add button.
26. In the Edit dialog box, type Yes in both the Use and Display boxes.
27. Click the add button.
28. In the Edit dialog box, type No in both the Use and Display boxes.
29. Click OK.
30. Pause the pointer over the condition explorer button and click Variables.
31. Click the showDesc variable, and in the Properties pane, double-click Report Expression.
32. In the Report Expression dialog box, type the following in the Expression Definition window:
ParamDisplayValue("p_ShowDesc") = 'Yes'
33. Click OK.
34. Pause the pointer over the page explorer button and click the report page.
35. Click the Descriptions column.
36. In the Properties pane, select the list column by clicking the select ancestor button and selecting List Column from the context menu.
37. In the Properties pane, double-click the Render Variable parameter and select the showDesc boolean variable you created in steps 24 to 33.
38. Click Run.
The report will prompt you for a date, and will then provide orders that occur after the date you entered. The report will also ask if the Descriptions column is to be shown, and the column will be rendered only if you choose Yes to this selection.

Comments

  1. Thanks Arul! This saved me probably many days of fiddling with Cognos! You're awesome.

    ReplyDelete

Post a Comment

Popular posts from this blog

RSV-VAL-0032 expression is not valid. If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '0'.

How can you extract all user information from Cognos Access Manager Namespace Report Utility and create Cognos Report out of it?

BME-EX-0047 Unable to read preferences for the requested interface..