Hi All,
I'm using Visual Studio 2010 with the various required plugins installed to communicate with SAP Crystal Server 2011. Everything is working fine and I can query data (e.g. return a list of folders within a folder) with no problems.
I'm trying to integrate this with the CrystalReportViewer component which appears to be working until I attempt to load the returned InfoObject into ReportDocument.Load (line in bold). It always returns:
Unknown error 0x80040200.
Any ideas? I'm at a bit of a loss. Other suggestions for how to do this I'll take on board as well.
Just to clarify. The Logon works fine, InfoObject is valid (the Response.Write returns the correct ID and Title of the Report).
SessionMgr ceSessionMgr = new SessionMgr();
EnterpriseSession ceSession = ceSessionMgr.Logon(ConfigurationManager.AppSettings["CrystalUser"].ToString(), ConfigurationManager.AppSettings["CrystalPassword"].ToString(), ConfigurationManager.AppSettings["CrystalServer"].ToString(), "Enterprise");
EnterpriseService ceEnterpriseService = ceSession.GetService("", "InfoStore");
InfoStore ceInfoStore = new InfoStore(ceEnterpriseService);
PluginManager cePluginMgr = ceInfoStore.PluginManager;
PluginInfo ceReportPlugin = cePluginMgr.GetPlugins("Desktop")["CrystalEnterprise.Report"];
InfoObjects ceInfoObjects = ceInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' AND SI_ID=" + Convert.ToInt32(Request["ReportID"]));
InfoObject ceInfoObject = ceInfoObjects[1];
Response.Write(ceInfoObject.ID.ToString() + " = " + ceInfoObject.Title + "<br/>");
CrystalDecisions.CrystalReports.Engine.ReportDocument ceReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ceReportDocument.Load(ceInfoObject, ceSession);
CrystalReportViewer1.Visible = true;
CrystalReportViewer1.EnterpriseLogon = ceSession;
CrystalReportViewer1.ReportSource = ceReportDocument;