VS2010水晶报表发布到IIS后报错:无效文件名 决心散100分
本帖最后由 johnnyxiao 于 2013-07-18 23:33:41 编辑 VS2010水晶报表发布到IIS后报错:无效文件名
我水晶报表安装的是CRforVS_13_0.exe 280M那个 在VS2010旗舰版开发webForm的报表 语言是C# win7系统
服务器环境是win2003 R2 + sql2005
最困惑的是同样的发布后文件放到测试的服务器可以正常呈现报表 而放到托管的服务器上就报错
两者环境几乎一样 都安装CRforVS_13_0.exe和VS2010旗舰版
前者在内网、用IP打开网站
后者只开放80和8088两个端口、用域名打开网站
不过这些有关系吗
2010的水晶发布确实很多问题 我几乎都遇到了 好不容易在测试服务器上通过 却栽在了托管服务器上。。。
请高手不吝赐教 thanks!
详细报错信息如下:
“/”应用程序中的服务器错误。
--------------------------------------------
无效文件名。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Runtime.InteropServices.COMException: 无效文件名。
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[COMException (0x800001fb): 无效文件名。]
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: 加载报表失败。]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +332
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +876
CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() +113
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type) +53
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet) +66
DyAnti.Web.Manage.Logistics.PrintDeliver.Page_Load(Object sender, EventArgs e) in E:\MyJob\QianCi\Web\DyAnti.Web\Manage\Logistics\PrintDeliver.aspx.cs:46
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
DyAnti.Web.App_Code.BasePage.OnLoad(EventArgs e) in E:\MyJob\QianCi\Web\DyAnti.Web\App_Code\BasePage.cs:29
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
代码如下:
using System;
using System.Data;
using System.Web.UI.WebControls;
using DyAnti.Web.App_Code;
using Net.Components.Common;
using Net.Components.UI;
using Net.Web.Management.Basic;
using Net.Web.Model.Basic;
using Net.Web.Model.Page;
using Net.Web.Validator;
using CrystalDecisions.ReportSource;
using CrystalDecisions.CrystalReports.Engine;
using System.Configuration;
using System.Data.SqlClient;
using Net.SystemServices.SiteSetting;
namespace DyAnti.Web.Manage.Logistics
{
public partial class PrintDeliver : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
string DeliverID = Convert.ToString(Request.QueryString["DeliverID"]);
DeliverID = "7";
if (string.IsNullOrEmpty(DeliverID))
{
MessageBox.Show("参数Id不能为空", "", MessageType.History, this);
return;
}
ReportDocument rd = new ReportDocument();
rd.FileName = Server.MapPath("CrPrintDeliver.rpt");
string strConn = ConfigurationManager.ConnectionStrings[WebSiteConst.WebConnString].ConnectionString;
SqlConnection con = new SqlConnection(strConn);
con.Open();
string sql = "select * from v_PrintDeliver where DeliverID=" + DeliverID;
SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
da.Fill(ds, "v_PrintDeliver");
rd.SetDataSource(ds);
this.CrystalReportViewer1.ReportSource = rd;
}
}
}