Here is some sample code to connect to the Business Objects CMS (Central Management Server) with .NET
Tip:
Please note that the QueryBuilder SQL will return a maximum of 1000 records even if there are more to be returned. So logic should be included that if 1000 sorted records are returned, you should requery to retrieve missed records or until a recordset with less than 1000 returned records occurs.
This sample is a .NET 3.5 application.
Create a simple project and add references to
CrystalDecisions.Enterprise
CrystalDecisions.Enterprise.Framework
CrystalDecisions.Enterprise.InfoStore
Sample Code:
using System;
using CrystalDecisions.Enterprise;
namespace ConsoleAConnection
{
class Program
{
static void Main(string[] args)
{
string query = "Select SI_ID,SI_KIND,SI_NAME,SI_PARENT_FOLDER FROM CI_INFOOBJECTS WHERE SI_KIND IN ('Folder','FavoritesFolder')";
InfoObjects infoObjects = getCMCConnection().Query(query);
if (infoObjects.Count > 0)
{
foreach (InfoObject infoObject in infoObjects)
{
string siId = "" + infoObject.Properties["SI_ID"] + ":" + infoObject.Properties.Count;
Console.WriteLine("SI_ID=" + siId);
}
}
else
{
Console.WriteLine("No results found for " + query);
}
}
static InfoStore getCMCConnection()
{
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession = sessionMgr.Logon("UserName", "Password", "ServerName", "secEnterprise");
EnterpriseService enterpriseService = enterpriseSession.GetService("InfoStore");
InfoStore infoStore = new InfoStore(enterpriseService);
return infoStore;
}
}
}
Sunday, January 11, 2009
Subscribe to:
Post Comments (Atom)

1 comments:
Thanks for the posts we are the professional web design and development company offering an array of services like template customization,web designing, CMS solutions, eCommerce solutions, Search engine optimization and Internet marketing.
CMS DESIGN
Post a Comment