Attempting to use the RAS service:
IEnterpriseSession enterpriseSession = null; ReportClientDocument reportClientDocument = null; try { // token provided enterpriseSession = CrystalEnterprise.GetSessionMgr().LogonWithToken(token); string[] serviceNames = enterpriseSession.GetServiceNames("", 0); using (EnterpriseService enterpriseService = (EnterpriseService)enterpriseSession.GetService("RASReportFactory")) { ReportAppFactory reportAppFactory = (ReportAppFactory)enterpriseService.Interface; reportClientDocument = reportAppFactory.OpenDocument(id, 0); reportClientDocument.RowsetController.GetSQLStatement(new GroupPath(), out string SQL); return SQL; }; // using } // try catch (SDKException e) { Debug.Print(e.Message); throw; } catch (Exception e) { Debug.Print(e.Message); throw; } finally { // why doesn't ReportClientDocument implement IDisposable? if (reportClientDocument != null) { reportClientDocument.Close(); reportClientDocument = null; } }
I see that the RasReportFactory is not in the list of services (GetServiceNames):
I see that the service is running in the CMC, however.
What am I missing?