C# 报告中的文件名无效
我的web应用程序由Arvixe托管。我还上传了aspnet_客户端文件夹。这工作正常,但几天后显示错误: 无效的文件名 调用C# 报告中的文件名无效,c#,crystal-reports,C#,Crystal Reports,我的web应用程序由Arvixe托管。我还上传了aspnet_客户端文件夹。这工作正常,但几天后显示错误: 无效的文件名 调用rd.Load(path)时出错。这在我的本地机器和iis7上都能正常工作。我已尝试授予c:\windows\Temp文件夹的完全权限; 使用rd.Close(),rd.Dispose()和GC.Collect()在代码隐藏中。 我甚至在windows注册表中检查了增加Crystal报表的打印限制 如何修复此错误 CrystalDecisions.Shared.Cryst
rd.Load(path)
时出错。这在我的本地机器和iis7上都能正常工作。我已尝试授予c:\windows\Temp文件夹的完全权限;
使用rd.Close()代码>,rd.Dispose()
和GC.Collect()代码>在代码隐藏中。
我甚至在windows注册表中检查了增加Crystal报表的打印限制
如何修复此错误
CrystalDecisions.Shared.CrystalReportsException: Load report failed. --->
System.Runtime.InteropServices.COMException: Invalid file name. at
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() --- End of inner exception stack trace --- at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() at
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) at
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) at STAREX.ReportViewer.Page_Load(Object sender, EventArgs e) in D:\abc\ReportViewer.aspx.cs:line 49
ReportViewer.aspx的页面加载:
protected void Page_Load(object sender, EventArgs e)
{
try
{
DataTable dt = new DataTable();
if ((DataTable)Session["datatable"] != null)
{
dt = (DataTable)Session["datatable"];
}
else
{
dt=null;
}
string path = Session["path"].ToString();
if (!File.Exists(path))
{
Response.Write("Unable to Locate");
}
else
{
rd = new ReportDocument();
rd.Load(path);
rd.SetDataSource(dt);
CrystalReportViewer1.ReportSource = rd;
}
}
catch (Exception ex)
{
}
}
从Data_Entry.aspx页面调用报告:
protected void lnkPrintInvoice_Click(object sender, EventArgs e)
{
try
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string code = (gridDataEntryDetail.DataKeys[gvrow.RowIndex].Value).ToString();
DataTable dt = new DataTable();
dt = bll.td_Bll("Select * from [View_Invoice] where Invoice_No ='" + code + "' ");
if (dt.Rows.Count > 0)
{
Session["Invoice"] = "Invoice";
dt.TableName = "View_Invoice";
Session["datatable"] = dt;
Session["path"] = Server.MapPath("~/Report/Crybilldom.rpt");
Response.Redirect("~/ReportViewer.aspx");
}
}
catch (Exception ex)
{
ExceptioError.Attributes.Remove("style");
lblExcption.Visible = true;
lblExcption.Text = "Exception Error !\t\t" + ex.Message;
}
}
我得到了解决方案,只需更换支持crystal的主机服务器。
AVEN.arvixe.com支持crystal,但有时它不支持crystal,我不知道为什么,所以如果您必须使用crystal report,我不推荐arvixe
谢谢 我得到了解决方案,只需更改支持crystal的托管服务器即可。
AVEN.arvixe.com支持crystal,但有时它不支持crystal,我不知道为什么,所以如果您必须使用crystal report,我不推荐arvixe
谢谢 对我来说,答案是联系Arvixe支持部门。似乎是权限问题。他们的答复:
我们一直在对共享服务器场进行一些系统架构更改,以便为客户提供更好的服务,我们正在努力使整个平台的配置统一。此更改期间受影响的一个因素是对某些驱动器的权限。我们正在积极开发一种解决方案,该解决方案为我们提供了所需的安全性,同时允许Crystal reports用户访问以运行报告
我已经对系统进行了一些编辑,如果您可以测试它,并让我们知道这是否解决了您的问题
对我来说,答案是联系Arvixe支持部门。似乎是权限问题。他们的答复:
我们一直在对共享服务器场进行一些系统架构更改,以便为客户提供更好的服务,我们正在努力使整个平台的配置统一。此更改期间受影响的一个因素是对某些驱动器的权限。我们正在积极开发一种解决方案,该解决方案为我们提供了所需的安全性,同时允许Crystal reports用户访问以运行报告
我已经对系统进行了一些编辑,如果您可以测试它,并让我们知道这是否解决了您的问题
你在哪台服务器上?我在rachid.arvixe.com上,从大约一周前开始,基本上有相同的问题。在那之前的几个月里,我的报告运行良好,没有任何变化。我在arivixe.com上。我搜索了越来越多的网站,但仍然没有找到任何解决方案。我想这是服务器错误。你在哪台服务器上?我在rachid.arvixe.com上,从大约一周前开始,基本上有相同的问题。在那之前的几个月里,我的报告运行良好,没有任何变化。我在arivixe.com上。我搜索了越来越多的网站,但仍然没有找到任何解决方案。我认为这是服务器错误。