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







Thursday, January 17, 2008

Show All Packages in Default.aspx -- CognosSDK.cs

Show all packages

 

The entry point to our Cognos SDK web solution will be Default.aspx.  This will be a basic web page that will only contain a listbox control and a command button.  The listbox will be populated with all of the package items that exist in the specified Cognos Content Store.

 

Default.aspx will call the CognosSDK.cs object in order to query the Cognos Content Store for a list of Content Store objects.  In this case, we will only be interested in retrieving the list of all Content Store package objects that are of the type packageConfiguration.

 

The Default.aspx.cs PageLoad() event will contain the following C# code.

 

if (!Page.IsPostBack)

                  {

                       

                        baseClass[] _bc =  _cogSDK.getObjects(_cmService, _CSTypePkg, null);

                 

                        if (_bc != null)

                        {

                              for(int i=0; i<_bc.Length; i++)

                              {

                                    if ( _bc[i] is packageConfiguration)

                                    {                            

                                          lstPackages.Items.Add(_bc[i].defaultName.value.ToString());                        

                                    }

                              }    

                        }

                  }

 

 

 

This will require the CognosSDK.cs object to be instantiated in order to access the getObjects() method.

 

public baseClass[] getObjects(contentManagerService1 _cmService, string _path, string _package)

 

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.