gpt4 book ai didi

asp.net - Crystal Reports "Load Report Failed"在服务器上运行报告时出错

转载 作者:行者123 更新时间:2023-12-02 10:01:15 26 4
gpt4 key购买 nike

我在服务器上收到错误“加载报告失败”,它在本地主机上运行时没有错误。我正在使用 VS 2008 和 .Net 3.5。

这是我的代码:

ReportDocument reportDocument = new ReportDocument();
String filePath = @"C:\abcSpaces\abc.com\xyz.com\wwwroot\Order Fulfilment.rpt";//full path
// I have tried OrderFullfilment.rpt and ~/OrderFullfilment.rpt and /OrderFullfilment.rpt
try
{
reportDocument.Load(filePath);
CrystalReportViewer1.ReportSource = reportDocument;
}
catch(Exception ex){
Label1.Text = ex.Message;
}

Aspx 页面部分:

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" Height="1291px"
ReuseParameterValuesOnRefresh="True" Width="1125px" />

^我尝试过使用

<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="expenseRep_summary.rpt">
</Report>
</CR:CrystalReportSource>

当然运气不好......

我的 web.config 部分用于引用程序集:

<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="MySql.Data, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="MySql.Data.Entity, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="MySql.Web, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.VSDesigner, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/></assemblies>
</compilation>

我已经尝试了 stackoverflow 中发布的所有这些解决方案:

CrystalReport Load report failed (不,我无法更改注册表或重新安装 Crystal 报表,我的网站托管在外部服务器上)

load report failed (objReport到底在哪里??)

I got the problem in Crystal Report- Error Messsage:Load report failed (我没有任何对象引用报告类:S)

Load report failed when implementing crystal report in asp.net 3.5 (我尝试了这种“~”技术+绝对路径,但没有任何效果)

Load report failed in Windows server 2003 (我已经为每个文件设置了读写执行权限)

https://stackoverflow.com/questions/3337185/crystal-report-giving-load-failed-error (像我这样的人,还没有找到解决方案:P)

所以请大家帮帮我!否则我的客户会把我活活吃掉...

最佳答案

我知道这是一篇旧帖子。但对于仍在寻找答案的人:

您需要在页面标记中注册 Crystal 报表

<% @ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

将报表的属性“复制到输出目录”设置为“始终复制”

crystalreportsource 中文件的路径为 ~/bin/YOURFOLDER/YOURFILE

<CR: CrystalReportSource ID ="CrystalReportSource1" runat ="server">
<Report FileName="~/bin/oilmovement/rptOMDayEnd.rpt">
</Report>
</CR: CrystalReportSource>

现在报告应该可以工作了

关于asp.net - Crystal Reports "Load Report Failed"在服务器上运行报告时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6879919/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com