Running a report with prompts

After collecting the prompt answers, you can run the report by submitting the prompt answers with the request.

REST example

The report can be run by including the promptAnswers element in an xmlData option as shown here.

http://localhost/ibmcognos/bi/v1/disp/rds/reportData/report/
ia195960a5e77488cb4583d74b56c78d6?v=3&xmlData=
<promptAnswers><promptValues><name>pYear</name><values><item><SimplePValue>
<inclusive>true</inclusive><useValue>[Employee summary].[Time]
    .[Time].[Year]-%26gt;[Time].[2006]</useValue>
<displayValue>2006</displayValue></SimplePValue></item></values></promptValues>
<promptValues><name>pRegion</name><values><item><SimplePValue><inclusive>true</inclusive>
<useValue>[Employee summary].[Employee by region].[Employee by region]
    .[Branch region]-%26gt;[Employee by region].[740]</useValue>
<displayValue>Asia Pacific</displayValue></SimplePValue></item></values>
   </promptValues></promptAnswers>

Alternatively, you can use a simplified expression using the p_parameter option.

http://localhost/ibmcognos/bi/v1/disp/rds/reportData/report/
ia195960a5e77488cb4583d74b56c78d6?v=3&p_pYear=
[Employee summary].[Time].[Time].[Year]->[Time].[2006]&p_pRegion=
[Employee summary].[Employee by region].[Employee by region]
   .[Branch region]->[Employee by region].[740]

In this case the value of each prompt is the value of the corresponding useValue element of the promptAnswers response.

SOAP example

To run a report with prompts, include promptValues objects (generic applications) or a PromptAnswersType object (report-specific application) in the report request.

Considerations if the display value is omitted when running a report with prompts

If you submit a prompted report and omit the display value, either by using the simplified expression in a REST application, or by omitting the optional displayValue parameter in a SOAP application, and the report uses the ParamDisplayValue function to display the prompt value, the prompt value shown in the report output will be the use value.