1533230 - Load report failed when viewing a Crystal report.

SAP Knowledge Base Article - Public

1533230 - Load report failed when viewing a Crystal report.

Symptom

  1. Publish a windows application in local IIS from Visual Studio 2010.
  2. Open the html page in browser and click on 'Install' button to install the windows application setup/exe.
  3. 'Load report failed' error is received when trying to view the Crystal report.(Detailed error message is attached as an attachment.)
    Load report failed.JPG

Environment

  • Visual Studio 2010.
  • SAP Crystal Reports for Visual Studio 2010.
  • IIS 7.
  • Windows application.

Reproducing the Issue

  1. Create a windowsform application in VS2010.
  2. Report is included in the project.
  3. Once the application executes properly, use 'Build' -> Publish <application name>, in VS IDE. Select 'Local IIS' to publish.
  4. Browse the publish.htm from IIS.
  5. 'Load report failed' error is received when trying to view the report.

Cause

When the application is published the report or application's exe is not moved inside the Inetpub\WWWroots folder. Hence, the following line of code, where the path of report is pointed inside the application folder, fails:
Reportdocument.Load(Application.StartupPath+"//..//..//MyReport.rpt");

Resolution

Give the absolute path of the report in the C# code, as shown in the example below:
ReportDocumentObject.Load("C:\\Windows\\Temp\\MyReport.rpt");

Keywords

c-sharp, .net, dot net, cr4vs2010 , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio

Attachments

Load report failed error message.txt