Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net iis发布后未加载rpt文件的Crystal报告问题_Asp.net_Iis 7.5 - Fatal编程技术网

Asp.net iis发布后未加载rpt文件的Crystal报告问题

Asp.net iis发布后未加载rpt文件的Crystal报告问题,asp.net,iis-7.5,Asp.net,Iis 7.5,首先report.Load(“C:\report\exam.rpt”) 此路径位于网站文件夹C:\Report\exam之外。将生成rpt报告 但是report.Load(Server.mapPath(“~\report\exam.rpt”)出现了一些错误 加载报告失败。在CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(字符串文件名、OpenReportMethod openMethod、Int16 parentJob)中,在

首先
report.Load(“C:\report\exam.rpt”)
此路径位于网站文件夹
C:\Report\exam之外。将生成rpt
报告

但是
report.Load(Server.mapPath(“~\report\exam.rpt”)
出现了一些错误

加载报告失败。在CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(字符串文件名、OpenReportMethod openMethod、Int16 parentJob)中,在CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(字符串文件名)中,在CrystalDecisions


如何解决此问题?

服务器。mapPath()采用您的应用程序路径。提供report.Load()的完整路径或将.rpt文件放在项目解决方案中。

我认为
~\report\exam.rpt
不会转换为物理路径C:\report\exam.rpt。可能转换为web应用程序物理路径。