7
votes

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

This is my code:

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 Page part:

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

^I have tried using

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

with no luck off course...

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>

I have tried all of these solutions posted in stackoverflow:

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

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

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

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

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

https://stackguides.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...

6
stackoverflow.com/questions/3321469/… this link is useful for me....thanks456qwe123asd

6 Answers

6
votes

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

Set the property 'Copy to Output Directory' of the report to 'Copy always'

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

2
votes
  • select your application pool for your apllication or website
  • Click on Recycling (Right side panel)
  • Reduce the value of Regular time interval 1740 to 20 min or set your desire value you want
  • this will release any resource hold by iis.
  • restart iis.

hope this will fix your problem

http://littleprograming.blogspot.com/2013/02/crystal-report-error-load-report-failed.html

1
votes

I have the same issue before and it seems you need to install the CR runtime on the server. Having just the DLL is not enough. Hope it helps.

1
votes

I know that this is an old question, but today I had similar problem. Reports were working locally but when deployed to server (IIS) I had the same error.

Try to add write/read permissions to %TEMP% for IIS User (process that creates reports).

Reports are generated in Temp and from there viewer is getting content that is displayed on site.

1
votes

I also had that problem and after exhausting all other options changed the Application Pool setting Load User Profile from False to True, which resolved the problem.

This was on an application which has been deployed to dozens of IIS6, IIS7, IIS7.5 servers and we've never encountered the problem before. The App Pool was running with the identity Network Service (which it usually is) and I first tried giving permission to C:\windows\temp which did not work (although I didn't check if that really was the temp directory).

I suspect another solution may have been to add Network Service to the IIS_IUSRS group, but I didn't try that and didn't really want to do so in case it affected other apps on the server.

0
votes

On of the most common reason can be, Crystal Report (*.rpt) files are not physically present in the target location, which might have left-out during build and publishing application

Solution:
Open Visual Studio, select all the CrystalReport.rpt files, right click to set Properties"

Build Action: Content (can also be Embedded Resource)
CopyToOutputDirectory: Always (can also be Copy if Newer)