在 IIS 中部署应用程序时水晶报表无法加载 [英] Crystal report fails to load when application is deployed in IIS
问题描述
我将 packageTmp 复制到 inetpub/wwwroot,然后添加了一个网站并将其作为我的路径.
I copied the packageTmp over to the inetpub/wwwroot, then added a website and included it as my path.
安装了水晶报表运行时,CRRuntime_32bit_13_0_4 - 但仍然没有工作.
Installed the crystal report runtime, CRRuntime_32bit_13_0_4 - but still did not work.
我在 wwwroot/aspnet _client/systemweb/4_0_30319 中也有 Crystalreportviewers13 文件夹
I also have crystalreportviewers13 folder in wwwroot/aspnet _client/systemweb/4_0_30319
这是我用水晶报表进入页面时遇到的错误.我可以知道路径在哪里定义吗?当我在 IIS 中部署我的应用程序时会出现此问题.
This is the error I encountered when I go to the page with crystal report. May i know where the path is defined? This problem occurs when I deploy my application in IIS.
异常详细信息:System.Runtime.InteropServices.COMException:文件名无效.
Exception Details: System.Runtime.InteropServices.COMException: Invalid file name.
来源错误:
在执行当前 Web 请求期间产生了一个未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息.
堆栈跟踪:
[COMException (0x800001fb): 文件名无效.]CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +270[CrystalReportsException:加载报告失败.]CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +333CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(字符串文件名,OpenReportMethod openMethod,Int16 parentJob)+877CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob) +1183CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() +113CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type) +53CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable)
....
这是.aspx代码后面的.cs代码,用于reportxx.rpt
This is the .cs code behind the .aspx code,for reportxx.rpt
m_reportxx = new reportxx();
CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
DataTable dt = data.GetReport();
reportxx.SetDataSource(dt);
CrystalReportViewer1.ReportSource = m_reportxx;
我试过这个,它在 Visual Studio 环境中调试时工作.
I tried this and it worked while debugging in the visual studio environment.
推荐答案
在我的情况下,我发现了 2 天的错误并没有发现任何问题...最后我使用了 Procmon.exe (https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255&MSPPError=-2147217396) 来跟踪错误.我按 Result + is not + SUCCESS 过滤,我尝试再次运行 Web 应用程序并出现错误:ACCESS DENIED 到文件夹 X.我授予 X 文件夹正确的权限并且工作正常.
In my case, I found by 2 days the error and not see nothing wrong...Finally I used Procmon.exe (https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255&MSPPError=-2147217396) to trace the error. I Filter by Result + is not + SUCCESS, I tried to run again the web application and appear the Error: ACCESS DENIED to Folder X. I give the right permission to X folder and works fine.
这篇关于在 IIS 中部署应用程序时水晶报表无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!