VS2008 and Crystal Reports Server 2008
Hi,
I am trying to connect to CR Server 2008 using the following VB.Net code but keep getting the following exception: Could not load file or assembly 'BusinessObjects.Enterprise.Sdk, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified. I have installed the CR Server 2008 Client Tools.
Where can i get the above dll?
Below is the code i'm using and i have highlighted the line that generates the error.
Try Dim serverName As String = "servername" Dim mySessionMgr As SessionMgr = New SessionMgr() 'Logon to the enterprise box Dim myEnterpriseSession As EnterpriseSession = mySessionMgr.Logon("Administrator", "pwd", serverName, "secEnterprise") 'Exception raised at line below Dim myEnterpriseService As EnterpriseService = myEnterpriseSession.GetService("InfoStore") Dim myInfoStore As InfoStore = New InfoStore(myEnterpriseService) myEnterpriseService = myEnterpriseSession.GetService("PSReportFactory") Dim psrfObject As Object = myEnterpriseService.Interface Dim myPSReportFactory As PSReportFactory = CType(psrfObject, PSReportFactory) Dim queryString As String = "Select SI_ID, SI_NAME, SI_PARENTID From CI_INFOOBJECTS " _ & "Where SI_PROGID='CrystalEnterprise.Report' " Dim myInfoObjects As InfoObjects = myInfoStore.Query(queryString) Dim myInfoObject As InfoObject = myInfoObjects(1) Dim myReportSource As ReportSource = myPSReportFactory.OpenReportSource(myInfoObject.ID) Catch ex As Exception strMsg = ex.Message End Try
Thanks
Daniel Paulsen replied
hmmm..."No route to host exception"
sounds like a failure for the web services to connect to the CMS. Try using the machine name instead of localhost for the Session URL.
Also, is this a multi-homed machine (multiple nics). If so, make sure the nic with the IP the CMS is using is at the top of the binding order.
if developing with the 2.0 .net framework, ensure the assemblies you added for the DSWS consumer dlls are from the dswsDotNet2Api folder, otherwise use the dlls in the dswsDotNetApi folder for 1.1 framework applications.
the source code looks correct