CRYSTAL REPORT FOR VISUAL STUDIO 2010 ASP.NET无效文件名错误
嘿大家我正面临着这个错误与水晶报告CRYSTAL REPORT FOR VISUAL STUDIO 2010 ASP.NET无效文件名错误
'/'应用程序中的服务器错误。
无效的文件名。
描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关该错误的更多信息以及源代码的位置。
异常详细信息:System.Runtime.InteropServices.COMException:无效的文件名。
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[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) +876
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +84
WebPathLab.AgentList.Page_Load(Object sender, EventArgs e) +524
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.272
======================== 我使用Visual Studio 2010. Crystal报表版本为13.0。 2000 我已经进入了下面一行在web.config中
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
我的水晶报表工作正常,当我从Visual Studio中按F5运行2010
目录结构
报告/数据集/ Dataset1.xsd Reports/rpt/CrystalReport1.rot 报告/ AgentList.aspx
导入的命名空间
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.IO
代码隐藏
Dim reportpath As String = Server.MapPath("rpt/CrystalReport1.rpt")
com.CommandText = "SELECT idAgent AS ID,AgentName,Add1 AS Address FROM PmAgentMaster"
com.Connection = conPatho
da.SelectCommand = com
dt.Rows.Clear()
If conPatho.State = ConnectionState.Closed Then conPatho.Open()
da.Fill(dt)
conPatho.Close()
Dim ds As New DataSet1()
ds.Tables(0).Merge(dt)
ShowPopUpMsg(reportpath)
Dim rptDoc As New ReportDocument()
rptDoc.Load(reportpath)
rptDoc.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rptDoc
谁能帮我。请。
试试这个(注意波浪线):
Server.MapPath("~/rpt/CrystalReport1.rpt")
加载报告失败。 错误出现时使用使用Server.Mappath( “〜/ RPT/CrystalReport1.rpt”) 我的申请directroy结构是 〜/ webpathlab /表格/报告/数据集/ Dataset1.xsd 〜/ webpathlab /表格/报告/ RPT/CrystalReport1.rot 〜/ webpathlab/Forms/Reports/AgentList.aspx – 2013-05-03 14:57:09
初始化后,reportpath设置为什么。这是对的吗? – 2013-05-04 04:21:53
D:\ WEBDATA \ pathology-software.com \ webpathlab \ Forms \ Reports \ rpt \ CrystalReport1.rpt 上述路径由reportpath返回,它是正确的。在服务器CrystalReport1.rpt在那里存在。 – 2013-05-04 12:01:36
谁看见我的CapsLock键? – Arvo 2013-05-03 13:47:48