Collecting prompts from a tree prompt page
Some reports have a tree prompt page. An example of such a report is the sample report Public Folders > Samples > Models > GO Data Warehouse (query) > SDK Report Samples > Tree prompt sample.
If you use the IBM® Cognos® prompt user interface, the prompt page has a hierarchical tree structure that you can use to drill down to a product category or product.

After you submit prompt values, they can be retrieved in the same way as any other prompted report.
If you collect prompts yourself, retrieve the prompt information that is associated with the first level hierarchy (Products). For more information, seeCollecting prompts with an alternate interface.
To drill down to lower levels in the prompt tree, use the treePromptNode
secondary
operation, to specify the pname
and use
values from the
response. The response is an RDS page that contains a treePromptNode
element.
For example:
<rds:treePromptNode xmlns:rds="http://developer.cognos.com/schemas/rds/types/2">
<rds:options>
<rds:useValue>[Sales].[Products].[Products].[Product line]->[all].[991]</rds:useValue>
<rds:displayValue>Camping Equipment</rds:displayValue>
</rds:options>
<rds:options>
<rds:useValue>[Sales].[Products].[Products].[Product line]->[all].[992]</rds:useValue>
<rds:displayValue>Mountaineering Equipment</rds:displayValue>
</rds:options>
<rds:options>
<rds:useValue>[Sales].[Products].[Products].[Product line]->[all].[993]</rds:useValue>
<rds:displayValue>Personal Accessories</rds:displayValue>
</rds:options>
<rds:options>
<rds:useValue>[Sales].[Products].[Products].[Product line]->[all].[994]</rds:useValue>
<rds:displayValue>Outdoor Protection</rds:displayValue>
</rds:options>
<rds:options>
<rds:useValue>[Sales].[Products].[Products].[Product line]->[all].[995]</rds:useValue>
<rds:displayValue>Golf Equipment</rds:displayValue>
</rds:options>
</rds:treePromptNode>
You can submit a prompted report to run by submitting the pname
and useValue
values, or
you can submit extra treePromptNode
requests by specifying
the original pname
value and a useValue
value from
the response. If you attempt to drill down below the lowest level,
the response is an empty treePromptNode
element.
REST example
This example is based on the Tree prompt sample report available in the sample database. Submit the following URL to the IBM Cognos Analytics server:
http://localhost/ibmcognos/bi/v1/disp/rds/reportPrompts/report/iAB3DAAF3A4A9446E9445C6C0C1693EC2?v=3
The response is an LDX page that contain the Products category. Note the URL that is associated with the response page: Submit the following secondary request:
http://localhost/ibmcognos/bi/v1/disp/rds/sessionOutput/conversationID/iD41D1EE47B1148EB97B57C7CB4AFEBBB/treePromptNode?v=3&p_ProductPara=[Sales].[Products].[Products].[Products]->[all]
The
response is the treePromptNode
element.
Select the Personal Accessories category to
drill down further, by using the following request:
http://localhost/ibmcognos/bi/v1/disp/rds/sessionOutput/conversationID/iD41D1EE47B1148EB97B57C7CB4AFEBBB/treePromptNode?p_ProductPara=[Sales].[Products].[Products].[Product line]->[all].[993]
You can use the response to run the report on the Binoculars category as described in Running a report with prompts by using the following parameter:
p_ProductPara=[Sales].[Products].[Products].[Product type]->[all].[993].[963]
SOAP example
For examples of using tree
prompts in the C# and Java™ programming
languages, see the ExpandTreePrompt
samples programs.