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 3, 2008

CognosSDK.cs -- Request Content Store Objects

The Cognos Content Store contains the metadata representation of items such as reports, query items, report views, and security settings. The Cognos SDK code can call the Content Manager’s .query() method to search for and retrieve Content Store items. The getObjects() method is an example of searching the Content Store and finding either all Content Store package items or all report items for a specified package.

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

{
propEnum[] _props = new propEnum[]{propEnum.searchPath,propEnum.defaultName,propEnum.objectClass, propEnum.modificationTime, propEnum.connectionString, propEnum.creationTime, propEnum.link, propEnum.specification, propEnum.version, propEnum.defaultName, propEnum.portalPages, propEnum.ancestors, propEnum.owner};



if(_cmService != null)

{

sort[] _sort = {new sort()};

_sort[0].order=orderEnum.ascending;

_sort[0].propName=propEnum.defaultName;



_packagePath = "/content//package/*";

_reportPath = "/content/package[@name='" + _package + "']/report//*";



searchPathMultipleObject _spMulti = new searchPathMultipleObject();



if (_path == "packageConfiguration")

{

_path = _packagePath;

}

else if (_path == "report")

{

_path = _reportPath;

}

else

{

_path = null;

}



_spMulti.Value = _path;



try

{

//Query Cognos 8 and return the Base Class Array to the calling method

baseClass[] _bc = _cmService.query(_spMulti, _props, _sort, new queryOptions());

if(_bc != null)

{

//if the search request returned results

if(_bc.Length > 0)

{

return _bc;

}

else

{

return null;

}

}

}





catch(Exception ex)

{

_ErrMsg = ex.Message.ToString();

return null;

}

}



//no results found

return(null);

}

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.