1540577 - Error: '<path to report file>' is a physical path, but a virtual path was expected

SAP Knowledge Base Article - Public

1540577 - Error: '<path to report file>' is a physical path, but a virtual path was expected

Symptom

  • Running a Windows application created in VS 2010, using CRVS2010 results in the exception:

System.Web.HttpException was unhandled by user code
  ErrorCode=-2147467259
  Message='C:/xcrystal/chart.rpt' is a physical path, but a virtual path was expected.
  Source=System.Web
  WebEventCode=0
  StackTrace:
       at System.Web.Util.UrlPath.CheckValidVirtualPath(String path)
       at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
       at System.Web.VirtualPath.Combine(VirtualPath relativePath)
       at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
       at System.Web.HttpRequest.MapPath(VirtualPath virtualPath)
       at System.Web.HttpServerUtility.MapPath(String path)
       at CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object value)
       at CrystalDecisions.Web.CrystalReportViewer.set_ReportSource(Object value)
       at WebApplication4._Default.CrystalReportViewer1_Init(Object sender, EventArgs e) in c:\test\WebApplication4\WebApplication4\Default.aspx.vb:line 14
       at System.Web.UI.Control.OnInit(EventArgs e)
       at CrystalDecisions.Web.CrystalReportViewerBase.OnInit(EventArgs e)
       at CrystalDecisions.Web.CrystalReportViewer.OnInit(EventArgs e)
  InnerException:

Environment

Cause

  • The path to the report file is incorrect

Resolution

  • Ensure that a correct path to the report file exists

Keywords

cr4vs 2010 cr4vs2010 crvs2010 crvs , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio