Reputation: 899
I'm trying to make a page display conditionally based on a prompt in Cognos 10.1.
I have a prompt page with a dropdown that is populated by a query named PromptSQL. PromptSQL returns a table with two columns, Value and Descr. The Value Prompt on the prompt page has had the following properties altered:
Query: PromptSQL
Use Value: Value
Display Value: Descr
Parameter: Location
I created a boolean variable, vShowPage, to determine if one of the report pages, Page 2, should be displayed. The code under vShowPage is simply:
?Location? in ('12', '15', '20')
So, I only want the "Page 2" page to be printed if the location selected is 12, 15 or 20.
I then selected "Page 2" under Report Pages and associated vShowPage to the Render Variable property. When I validate the report I get the following error:
RSV-VAL-0032 The following expression is not valid: ?Location? in ('12','15','20'). 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'. The variable named '?Location?' is invalid.
I also tried changing the variable to a String Variable, but listing all of the possible values will be problematic. But even the small test I did using the String Variable resulted in the same error.
I tried adding PromptSQL to the Query property of Page 2 and checking the Value column under the Properties property. I even tried checking Value and Descr. These all produced the same error.
I used this link from IBM's web-site as my template for doing this: How To: Hide a report page based on a prompt
Any help figuring this out would be greatly appreciated.
Upvotes: 2
Views: 4502
Reputation: 2404
You can't use the prompt value ?Location? in the conditional expression. Use ParamDisplayValue('Location') or ParamValue('Location') instead, e.g.: ParamValue('Location') in ('12','15','20').
Upvotes: 2