Symptom
- Publish a windows application in local IIS from Visual Studio 2010.
- Open the html page in browser and click on 'Install' button to install the windows application setup/exe.
- 'Load report failed' error is received when trying to view the Crystal report.(Detailed error message is attached as an attachment.)
Environment
- Visual Studio 2010.
- SAP Crystal Reports for Visual Studio 2010.
- IIS 7.
- Windows application.
Reproducing the Issue
- Create a windowsform application in VS2010.
- Report is included in the project.
- Once the application executes properly, use 'Build' -> Publish <application name>, in VS IDE. Select 'Local IIS' to publish.
- Browse the publish.htm from IIS.
- '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 |