Skip to Content
Former Member
Nov 01, 2010 at 05:36 PM

"Failed to find an available Report Application Server." - Error


I'm using .net sdk to connect to Crystal report server XI R2 from Visual Studio 2005.

I was able to successfully run reports from .net app until I upgraded my Crystal Report Server from XI R2 to Crystal Report Server 2008.

Now when I try to run the report from .net app it connects fine to Enterprise and retrieves the report fine, but it failing near the code

reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID, 0);

Is there a way to get this working? Any advice is greatly appreciated.

My code is as below:

SessionMgr sessionMgr = new SessionMgr();

EnterpriseSession enterpriseSession;

ReportAppFactory reportAppFactory;

ReportClientDocument reportClientDocument=new ReportClientDocument();

EnterpriseService enterpriseService;

InfoStore infoStore;

InfoObjects infoObjects;

InfoObject infoObject;



// set the name of the CR server

String crServerName = ConfigurationManager.AppSettings.Get("CRServerName");

// set userid to logon to CR server

String crUserID = ConfigurationManager.AppSettings.Get("CRUserID");

//set pwd to logon to CR server

String crPwd = ConfigurationManager.AppSettings.Get("CRPwd");

//set userid to logon to database

String dbUserID = ConfigurationManager.AppSettings.Get("DBUserID");

//set pwd to logon to database

String dbPwd = ConfigurationManager.AppSettings.Get("DBPwd");

//set connection Info to logon to database

String dbServerName = ConfigurationManager.AppSettings.Get("DBServerName");

//pass Crystal enterprise logon credentials

enterpriseSession = sessionMgr.Logon(crUserID, crPwd, crServerName, "secEnterprise");

enterpriseService = enterpriseSession.GetService("InfoStore");

infoStore = new InfoStore(enterpriseService);

//pass the report Name to query and pass it to reportClientDocument

infoObjects = infoStore.Query("Select SI_ID From CI_INFOOBJECTS Where SI_NAME='" + reportName + "' And SI_INSTANCE=0");

infoObject = infoObjects[1];

//Connecting to RAS (Report Aplication Server)

EnterpriseService tempService = enterpriseSession.GetService("", "RASReportFactory");

reportAppFactory = (ReportAppFactory)tempService.Interface;

reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID, 0);

// Pass datbase logon credentials

reportClientDocument.DatabaseController.LogonEx(dbServerName, "", dbUserID, dbPwd);