Buy the Cognos SDK Guide by BI Centre Now

The Cognos SDK Guide by BI Centre provides you with the complete source code for a C# web solution, C8.1 report based on the GOSR package, and a Word document that will serve as your core reference to understanding the Cognos 8 SDK. It will cover C8 SDK topics such as: authentication; querying the Cognos content store; rendering a C8 report in ASP.NET; exception handling; and much more.



Buy the Cognos 8 Modification Check Now







Monday, December 31, 2007

CognosSDK.cs -- Authentication

Authentication

The CognosLogon() method handles the authentication to the Cognos Report Service. This method permits a BIBus API value to be set and connected to Cognos 8. We have stored our authentication values in our web solution’s web.config file. We’ll discuss how to retrieve these values in the section named – web.config.

Here is the example code to authenticate a user to Cognos 8. The code is appending encoded xml with the stored values from the web.config file. The Content Manager service’s .logon() method is passed the encoded xml and it will return a valid CAMPassportId. If the user fails to be authenticated then an error message is passed to a string variable, which can then be displayed to the end user.

public string CognosLogon(contentManagerService1 cmService, string NmSpace,string uid, string pwd)
{
string CAMPassportID;
string credentialXML;
credentialXML= ""+ NmSpace + "";
credentialXML= credentialXML +"" + uid + "";
credentialXML= credentialXML +"" + pwd + "
";

try
{
xmlEncodedXML xmlPath = new xmlEncodedXML();
xmlPath.Value = credentialXML;
cmService.logon(xmlPath,new searchPathSingleObject[]{});
CAMPassportID = _cmService.biBusHeaderValue.CAM.CAMPassport.id.ToString();

return CAMPassportID;
}

catch (Exception ex)
{
return _ErrMsg = ex.Message.ToString();
}

}

Cognos 8 SDK google search

Google

New C8 SDK Utility --- Cognos 8 Modification Check

The BI Centre C8 Modification Check provides a Cognos SDK developer with a workable C# solution that will allow you to:

· Search the Content Store for items that have been modified after a selected date value

For example, if you were looking for all reports that were modified on June 3rd, 2008 then you would select the date June 2nd, 2008. The code will search for all items that have been modified after the selected date value from the date control.

The results of the search are then rendered to a text box control.