Your Cognos SDK class will also contain several helper functions that will aid you in querying and executing against the Cognos 8 Content Store. One example is the sample code to resolve a report’s prompt page prompts and pass the final parameter collection a Report Service’s .run method. The purpose of the method is to iterate through the prompt page’s form collection and identify all Cognos 8 prompt controls by name and retrieve their associated value. This method requires that your Cognos 8 Report Author follows a standardized naming convention for the Report Studio prompt pages. For example, our sample Report Studio reports will name all of the prompt page prompts in the following manner.
v Date Time prompts – p_dteStartDate
v Value prompt – p_txtFirstName
v Multiple Select prompt – p_lstCity
NOTE: As you progress through the code in the CognosSDK.cs file you will find references to string functions that rely on this naming convention. You may be forced to alter your CognosSDK.cs code to work with your Cognos 8 Report Studio naming standards.
For example:
_promptType = nvcFormData.Keys[x];
int _posPrompt = _promptType.LastIndexOf("p_");
if (_posPrompt == 2)
{
_promptName = _promptType.Substring(2, _promptType.Length - 2);
_promptType = _promptType.Substring(_posPrompt + 2,3);
}