Crystal Reports“加载报告失败"在服务器上运行报告错误

Crystal Reports quot;Load Report Failedquot; error running report on the server(Crystal Reports“加载报告失败在服务器上运行报告错误)

本文介绍了Crystal Reports“加载报告失败"在服务器上运行报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am getting error "load report failed" on server, it runs without error on localhost. I am using VS 2008 with .Net 3.5.

这是我的代码:

ReportDocument reportDocument = new ReportDocument();
    String filePath = @"C:abcSpacesabc.comxyz.comwwwrootOrder 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 部分:

my web.config section for referencing assemblies:

<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 中发布的所有这些解决方案:

I have tried all of these solutions posted in stackoverflow:

CrystalReport 加载报告失败(不,我无法更改注册表或重新安装水晶报告,我的网站托管在外部服务器上)

CrystalReport Load report failed (no I can't change registry or re-install crystal reports, my site is hosted on external server)

加载报告失败(objReport到底在哪里??)

load report failed (where the hell is objReport??)

我在 Crystal Report 中遇到了问题- 错误消息:加载报告失败(我没有引用报告类的对象:S)

I got the problem in Crystal Report- Error Messsage:Load report failed (I have no object reffering to Report class :S)

实施时加载报告失败asp.net 3.5 中的水晶报告(我尝试了这种~"技术+绝对路径,但没有任何效果)

Load report failed when implementing crystal report in asp.net 3.5 (I tried this '~' technique + Absolute path and none works)

在 Windows server 2003 中加载报告失败(我已设置每个文件的读写执行权限)

Load report failed in Windows server 2003 (I have set read write execute permissions to every file)

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

https://stackoverflow.com/questions/3337185/crystal-report-giving-load-failed-error (this guy like me, hasn't found the solution yet :P )

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

So please please please help me! Or my client will eat me alive...

推荐答案

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

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" %>

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

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>

现在报告应该可以工作了

Now the report should work

这篇关于Crystal Reports“加载报告失败"在服务器上运行报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Crystal Reports“加载报告失败"在服务器上运行报告错误

基础教程推荐