Collecting prompts from multiple prompt pages

Some reports have multiple prompt pages. An example of such a report is the sample report Public Folders > Samples > Models > GO Data Warehouse (analysis) > Reporting Report Samples > Employee Training by Year.

If you use the IBM® Cognos® prompt user interface, the prompt page has Back and Next buttons, enabling you to provide responses to the prompts.

A single prompt with navigation buttons is shown here.

Figure 1. Single prompt with navigation buttons
This image shows a single prompt with navigation buttons.

After you submit prompt values, they can be retrieved as with any other prompted report.

If you are collecting prompts yourself, retrieve the prompt information associated with the first prompt page using the procedure described in Collecting prompts with an alternate interface.

To retrieve subsequent pages of prompt information, use the forward secondary operation, including the responses to prompts on the current page in the request. When the forward secondary operation for the last page has been submitted, the response from the server will include all prompt values.

Examples using the REST and SOAP interfaces are shown here.

REST example

Submit the following URL to the BI server:


http://localhost/ibmcognos/bi/v1/disp/rds/reportPrompts
/report/i20b89f17f37c4818a2e807614ccbb11f?v=3

The response is an LDX page containing information about the first prompt, in this case, the year. Note the URL associated with the response page:


http://localhost/ibmcognos/bi/v1/disp/rds/sessionOutput
/conversationID/i2f24a760fae047958356a7a0a9e99c1f?v=3

In order to get the second prompt page request, for the quarter, submit the following URL, using the forward secondary request along with the selected response to the prompt for the year (in this case, 2010).


http://localhost/ibmcognos/bi/v1/disp/rds/sessionOutput/conversationID/
i2f24a760fae047958356a7a0a9e99c1f/forward?v=3&
p_P_Year=[Employee training].[Time].[Time].[Year]->[Time].[2010]

The response is an LDX page containing the prompt request for the quarter of 2010 to be selected. When you have selected the quarter, submit the following URL to the server.


http://localhost/ibmcognos/bi/v1/disp/rds/sessionOutput/conversationID/
i2f24a760fae047958356a7a0a9e99c1f/forward?v=3&
p_P_Quarter=[Employee training].[Time].[Time].[Quarter]->[Time].[2010].[20103]

Since there are only two prompt pages, the response from the IBM Cognos Analytics server is a promptAnswers response as in the case with non-cascading prompt pages.

SOAP example

Submit a getReportPrompts request to the BI server. When the asynchronous conversation completes, the output from the server includes a PromptAnswerOutput object, which contains the promptValues objects, that contain the prompt information for the first prompt page.

After you have determined the prompt answers for the first prompt page, submit them to the BI server in a forward secondary request. the server response will include the promptValues for the second page of prompts. The server will return a PromptAnswerOutput object for the second prompt page.

When there are no more prompt pages to process, the response from the forward request will include promptValues for all the prompts in the report, which can now be run.

Notes

  • Although this sample report uses cascading prompts, the procedures are no different if the report has multiple, independent prompts.
  • If default values are available for prompts, you can use the finish secondary request to skip any subsequent prompt pages. This is equivalent to pressing the Finish button on a prompt page.
  • You can use the back secondary request to return to the previous prompt page. This is equivalent to pressing the Back button on a prompt page.
  • You can use the reprompt secondary request to submit one or more prompt responses and have the current prompt page refreshed instead of moving to the next prompt page. Use this request if the prompt page contains cascading prompts and you need to submit a prompt response before getting the next prompt request.