Skip to Content
0
Former Member
Jan 10, 2012 at 05:45 PM

ReportDocument.Load throwing System.InvaildCastException

24 Views

I am trying to upgrade our existing code base from XI R2 to BO 4.0 Patch 6. The BO enterprise server has already been upgraded but when trying to load our report document we are getting a casting error. I can run the report on the server.

Here is the code:

authenitcationType = "secEnterprise";

EnterpriseSession enterpriseSession = GetEnterpriseSession(userName, password, serverName, authenitcationType);

EnterpriseService enterpriseService = enterpriseSession.GetService("InfoStore");

if (enterpriseService != null)

{

InfoObject reportObject = GetReportObject(enterpriseService);

ReportDocument reportDocument = new ReportDocument();

reportDocument.Load(reportObject, enterpriseSession); <----- Error is thrown here

result = reportDocument;

}

GetEnterpriseSession looks like this:

EnterpriseSession result = null;

SessionMgr sessionMgr = new CrystalDecisions.Enterprise.SessionMgr();

if (sessionMgr != null) {

result = sessionMgr.Logon(userName, password, serverName, authenitcationType);

Here is the error:

System.InvaildCastException: Unknown error 0x80040200

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientocumentClass.set_EnterpriseSession(object ppSession) ...

It looks like it is calling a setter inside the call that is failing.

Has anybody else seen this? Any suggestions?