Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Reports "Load Report Failed" error running report on the server

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

like image 692
codefreak Avatar asked Jul 29 '11 23:07

codefreak


2 Answers

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

like image 68
Shezi Avatar answered Sep 22 '22 23:09

Shezi


  • 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

like image 21
Imamul Karim Tonmoy Avatar answered Sep 19 '22 23:09

Imamul Karim Tonmoy