Skip to Content
0
Former Member
Mar 20, 2009 at 06:21 PM

Crystal Report Viewer Control .NET SDK Load method throws the exception

64 Views

I´m trying to open a report published on a Crystal Reports Server 2008, installed on a Windows Server 2003 from a thick client application developed in Visual Studio 2008. This very simple application consists of a Crystal Report Viewer Control in which Iu2019m trying to show a report. The code for this example is:

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

SessionMgr mgr = new SessionMgr();

EnterpriseSession sess = mgr.Logon("Administrator", "Novabase0808", "desenv02", "secEnterprise");

ReportDocument doc = new ReportDocument();

doc.EnterpriseSession = sess;

doc.Load("ceis://@desenv02/SIDOC/SidocRep048", sess);

crystalReportViewer1.ReportSource = doc;

}

}

When I try to run the code the Logon call works fine but the Load method throws the exception:

CrystalDecisions.Shared.CrystalReportsException was unhandled

Message="Load report failed."

Source="CrystalDecisions.CrystalReports.Engine"

StackTrace:

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, EnterpriseSession enterpriseSession)

at TesteCrystalServer.Form1..ctor() in D:TrabalhoProjectosSIBSCodeTesteCrystalServerTesteCrystalServerForm1.cs:line 26

at TesteCrystalServer.Program.Main() in D:TrabalhoProjectosSIBSCodeTesteCrystalServerTesteCrystalServerProgram.cs:line 17

at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException: System.Runtime.InteropServices.COMException

Message="Failed to find an available Report Application Server."

Source="clientdoc.dll"

ErrorCode=-2147217387

StackTrace:

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)

at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

InnerException:

The server is running and Iu2019m able to open the report from the CMS and from Crystal Reports 2008 (Designer).

I know that the server exists and recognizes the report name because the error I get when I try an invalid report name like "ceis://@desenv02/SIDOC/SidocRep0482" is u201CThe specified BusinessObjects Enterprise report cannot be found. Please ensure the report exists and the filename is in the proper format.u201D

Could you please help me trying to find whatu2019s wrong?

Thanks

Paulo Ferro.