Posted by: R Manimaran | August 28, 2008

Connecting to Crystal Report Server using .net SDK

using CrystalDecisions.Enterprise; 

using CrystalDecisions.Enterprise.Desktop;

using CrystalDecisions.Enterprise.Viewing;
using CrystalDecisions.ReportAppServer.Controllers;
private

static InfoStore infoStore;

 

static void ConnectCrystalServer()
{
try
{
Log.WriteFile(“Connecting to CMS…”, Log.LogFileType.INFO);
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession = sessionMgr.Logon(Common.sCR_UserName,Common.sCR_Password,Common.sCR_CMSName,
Common.sCR_Authentication);
EnterpriseService enterpriseService = enterpriseSession.GetService(“InfoStore”);
Log.WriteFile(“Connected Successfully to CMS”,Log.LogFileType.INFO);
Log.WriteFile(Log.Decorate(“\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t”, ‘-‘, Log.DEC_STYLE.DEC_BOTTOM), Log.LogFileType.INFO); 
Log.WriteFile(string.Empty, Log.LogFileType.INFO);
infoStore =new InfoStore(enterpriseService);
}
catch (Exception  ex)
{
//Unable to connect to Crystal Report Server
Log.WriteFile(“Unable to connect to Crystal Report Server. Message:” + ex.Message,
Log.LogFileType.ERROR);
}
}

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: