Cognos SDK Guide by BI Centre can be purchased from PayPal.

You will have your own functional Cognos 8 SDK web solution that has been tailored to be scalable and flexible in order to adapt to your unique business requirements and solution architecture.


Thursday, January 10, 2008

CognosSDK.cs -- Helper Functions

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);

}