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


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 + "

xmlEncodedXML xmlPath = new xmlEncodedXML();
xmlPath.Value = credentialXML;
cmService.logon(xmlPath,new searchPathSingleObject[]{});
CAMPassportID =;

return CAMPassportID;

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


Creating your SDK object -- CognosSDK.cs

The CognosSDK.cs class file is used primarily for interacting with your Cognos Content Store. You will be adding methods that will enable you to: Authenticate and connect to the Cognos service; request and return Cognos Content Store objects; request and set report parameter values; and execute a report.

Cognos SDK Guide -- Step-by-step

We will start off by doing an overview of the Cognos SDK Guide components and then we'll do a step-by-step discussion about how to build up the code in your ASP.NET pages.

Our first detailed discussion will involve building up the code for the following ASP.NET pages that will call your Cognos SDK C# class files.

a. Default.aspx
b. Reports.aspx
c. PromptPage.aspx
d. Output.aspx

This will allow us to naturally progress into discussing the CognosSDK.cs and ExHanlder.cs class files. The CognosSDKHelper.js will be discussed in detail when we have developed our Cognos SDK solution to the point where it is ready to execute a report.

Thursday, December 27, 2007

Cognos 8 SDK -- Getting started with your ASP.NET C# solution

Our sample Cognos 8 SDK web solution will be developed with Visual Studio .NET 2003 (VS.NET 2003). VS.NET 2003 uses .NET Framework 1.0 and that means that we need to use both Cognos SDK .dlls -- cognosdotnet.dll and cognosdotnetassembly.dll in our web solution. If we were using .NET Framework 2.0 then we could use the Cognos SDK .dlls -- cognosdotnet_2_0.dll and cognosdotnetassembly_2_0.dll.

Let’s get started by building the sample file and folder structure for your Cognos 8 SDK web solution:

1. Create a new C# web application in VS.NET 2003 and name it “Cognos_SDK_template”.
2. Expand the project and right-click on References. Go ahead and add both the cognosdotnet.dll and cognosdotnetassembly.dll to your solution.
3. You will also have to ensure that System.Web.Services has been added to your solution.
4. Select the project name “Cognos_SDK_template” and right-click.
a. Add a folder and name it “includes”.
b. Add a C# Class file and name it “CognosSDK.cs”.
c. Add a C# Class file and name it “ExHandler.cs”.
d. Add a new .ASPX page and name it “Default.aspx”.
i. Right-click on this file and select “Set as Start Page”.
e. Add a new .ASPX page and name it “Reports.aspx”.
f. Add a new .ASPX page and name it “PromptPage.aspx”.
g. Add a new .ASPX page and name it “RunReport.aspx”.
h. Add a new .ASPX page and name it “Output.aspx”.
i. Add a new .HTML page and name it “PleaseWait.htm”.
5. Select the “includes” folder and right-click.
a. Add a new .js file and name it “CognosSDKHelper.js”.
b. You can do an internet search for a clipart that represents an hour glass and save the file in the “includes” folder as “executing.gif”.

You have now successfully created the main skeletal structure for your ASP.NET C# Cognos SDK solution.

Monday, December 24, 2007

Cognos SDK Developer Guide Overview

Cognos SDK Developer Guide Overview

The Cognos SDK Developer Guide is intended to provide a Cognos SDK developer with a workable C# solution that will allow you to:

· Search the Content Store for all package items
· Search the Content Store for all reports that belong to a specified package
· Generate a report’s prompt page
· Execute the report
· Display the report results in a browser window
· Handle soap exceptions and render a meaningful error message to the user

The Cognos SDK Developer Guide will walk you through the steps of generating your ASP.NET C# web solution and guide you through the process of creating your: ASP.NET pages; C# Class Files for Exception handling and Cognos SDK method calls; supporting JavaScript code; deciding upon which Cognos SDK DLLs to reference; and handling basic security by using the web.config.

Friday, December 21, 2007

Cognos 8 SDK Developer Guide -- development tools

Hello, before we start to get busy with some of the code we should make sure that everyone has access to some type of development tool.

You can take a look at this page if you don't have Visual Studio .NET 2003.

Friday, December 14, 2007

Cognos 8 SDK -- BI Centre SDK Guide Update

  1. Hello, here is the initial Table of Contents for the upcoming BI Centre SDK Guide which will be available on If you have any questions or items that you would like to have covered in the Cognos SDK guide then feel free to email me at: BI Centre SDK Guide.

    Table of Contents

    Getting started with your ASP.NET C# web solution
    VS.NET Version
    Cognos SDK DLL references
    Project Structure
    Creating your SDK object
    Get Content Store Objects
    Get Params
    Helper Functions
    Exception Handler Class
    Storing credential values
    Searching for Content Store Items
    Show all packages
    Show reports for a package
    Run a report with prompts
    Displaying the report results
    Contact for more information

Wednesday, November 28, 2007

BI Centre SDK Guide

Be sure to visit this blog for the BI Centre SDK Guide. We'll walk you through the creation of integrating your Cognos 8 reports within a sample ASP.NET web application.

We'll post updates to the site to keep you informed on when you'll be able to get a copy of the sample code.

Cognos 8 SDK google search


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.