I am using below code to connect to a SAP cms server to get the reports from it.
using CrystalDecisions.Enterprise;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string username = "user";
string password = "pwd";
string server = "srv_name";
string auth_type = "authType";
// logon
SessionMgr session_mgr = new SessionMgr();
EnterpriseSession boEnterpriseSession = session_mgr.Logon(username , password, server, auth_type);
//boInfoStore = (IInfoStore)boEnterpriseSession.getService("InfoStore");
//boInfoStore = (IInfoStore)boEnterpriseSession.GetService("InfoStore");
// get the serialized session
//string session_str = session.SerializedSession;
// pass the session to our custom bypass page on the CRS
}
}
But I am getting below mentioned error while executing following line of code : SessionMgr session_mgr = new SessionMgr();
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.Enterprise.Framework.dll
Additional information: Retrieving the COM class factory for component with CLSID {6670DE06-3F39-4C5D-9238-71FF984D2654} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).