在IIS中部署应用程序时,Crystal报表无法加载
我将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选项)+0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath,Int32选项)+95
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()+270
[CrystalReportsException:Load报表失败。]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()+333
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename,OpenReportMethod openMethod,Int16 parentJob)+877
CrystalDecisions。 CrystalReports.Engine.ReportClass.Load(String reportName,OpenReportMethod openMethod,Int16 parentJob)+1183
CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()+113
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal Object val,Type type)+53
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable)
....
[COMException (0x800001fb): Invalid file name.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +270
[CrystalReportsException: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +333
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +877
CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob) +1183
CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() +113
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type) +53
CrystalDecisions.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;
我试过这个,它在视觉工作室环境中调试时工作。
I tried this and it worked while debugging in the visual studio environment.
我知道这是一个老帖子。但对于仍在寻找答案的任何人:
I know this is an old post. but For anyone still looking for the answer:
您需要在页面标记中注册水晶报告
You need to register crystal reports in page markup
<% @ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
将报表的属性复制到输出目录 strong>始终复制
Set the property 'Copy to Output Directory' of the report to 'Copy always'
crystalreportsource中的文件路径将为〜/ bin / YOURFOLDER / YOURFILE
the path of the file in the crystalreportsource will be ~/bin/YOURFOLDER/YOURFILE
<CR: CrystalReportSource ID ="CrystalReportSource1" runat ="server">
<Report FileName="~/bin/oilmovement/rptOMDayEnd.rpt">
</Report>
</CR: CrystalReportSource>
现在报表应该工作