1578334 - How to use a report based on SAP ECC data which is accessed using the Crystal Open SQL driver

SAP Knowledge Base Article - Public

1578334 - How to use a report based on SAP ECC data which is accessed using the Crystal Open SQL driver

Symptom

  • Trying to run a Crystal Report connected to SAP ECC data in a VS .NET application
  • On report load the following error is thrown:

Error: CrystalDecisions.Shared.CrystalReportsException was unhandled
Message="Load report failed."
Source="CrystalDecisions.CrystalReports.Engine"

Environment

  • Crystal Reports 2008
  • VS .NET 2008
  • Crystal Open SQL driver (Database Type: SAP Table, Cluster, or Function)

Resolution

  • The load method must be executed by passing an Enterprise session (even if the report isn't housed in InfoView)
  • Example code:
ReportDocument oRpt = new ReportDocument();
CrystalDecisions.Enterprise.EnterpriseSession oEnterpriseSession = (new CrystalDecisions.Enterprise.SessionMgr()).Logon("Administrator", "youradminpassword", "yourinfoviewserver", "Enterprise");
oRpt.Load(reportFileName,oEnterpriseSession);
oRpt.SetDatabaseLogon("yourSAPuserID", "yourSAPpassword");
crystalReportViewer1.ReportSource = oRpt;

Keywords

SAP ERP Central Component , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem

Product

Crystal Reports 2008 V1