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应用程序物理路径。