title: Load Report Failed On Server - Crystal Reports
body: <p>I have a crystal report viewer page that displays a report perfectly well on my desktop development computer. The code I have used for this viewer page is:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using LoyalitySystem;
  using System.Configuration;
  using HQ.DatabaseGateway;
  using CrystalDecisions.CrystalReports.Engine;
  using CrystalDecisions.Shared;
  using System.IO;
  
  public partial class WebPages_DynamicReports_CrystalReportViewerPage : BasePage
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          string reportPath = Server.MapPath((string)Utils.GetSessionNavigator(this).GetDataFromCurrentPage(PageParams.Reports.Report));
          ReportDocument rep = new ReportDocument();
  
          try
          {
              if (!File.Exists(reportPath))
              {
                  Response.Write("The specified report does not exist \n");
              }
  
              rep.Load(reportPath);
              LoadReport(rep);
              this.CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
              this.CrystalReportViewer1.HasToggleGroupTreeButton = false;
              this.CrystalReportViewer1.ReportSource = rep;
          }
          catch (Exception ex)
          {
              Response.Write(ex.Message);
          }
      }
  
      private bool LoadReport(ReportDocument doc)
      {
          TableLogOnInfo crTableLogonInfo;
          Sections crSections;
          Database crDatabase;
          Tables crTables;
          ReportDocument crSubreportDocument;
          ReportObjects crReportObjects;
          SubreportObject crSubreportObject;
  
          try
          {
              ConnectionInfo con = new ConnectionInfo();
              con.ServerName = ConfigurationManager.AppSettings["dbsource"];
              con.DatabaseName = Utils.GetSessionNavigator(this).UserData.DatabaseName;
              con.UserID = ConfigurationManager.AppSettings["uid"];
              con.Password = ConfigurationManager.AppSettings["pwd"];
              crDatabase = doc.Database;
              crTables = crDatabase.Tables;
  
              //loop through all the tables and pass in the connection info
              foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
              {
                  crTableLogonInfo = crTable.LogOnInfo;
                  crTableLogonInfo.ConnectionInfo = con;
                  crTable.ApplyLogOnInfo(crTableLogonInfo);
              }
  
              // set the crSections object to the current report's sections
              crSections = doc.ReportDefinition.Sections;
  
              // loop through all the sections to find all the report objects
              foreach (Section crSection in crSections)
              {
                  crReportObjects = crSection.ReportObjects;
                  // loop through all the report objects to find all the subreports
                  foreach (ReportObject crReportObject in crReportObjects)
                  {
                      if (crReportObject.Kind == ReportObjectKind.SubreportObject)
                      {
                          crSubreportObject = (SubreportObject)crReportObject;
  
                          // open the subreport object
                          crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
  
                          // set the database and tables objects to work with the subreport
                          crDatabase = crSubreportDocument.Database;
                          crTables = crDatabase.Tables;
  
                          // loop through all the tables in the subreport and 
                          // set up the connection info and apply it to the tables
                          foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                          {
                              crTableLogonInfo = crTable.LogOnInfo;
                              crTableLogonInfo.ConnectionInfo = con;
                              crTable.ApplyLogOnInfo(crTableLogonInfo);
                          }
                      }
                  }
              }
          }
          catch (Exception e)
          {
              Response.Write(e.Message);
              return false;
          }
  
          return true;
      }
  }
  </code></pre>
  
  <p>As previously stated, this works fine when locally hosting my application, but on the production server I am getting Load Report Failed on every report that I run, and from my check to see if the file exists, I can see that the requested file is being found.</p>
  
  <p>My .aspx markup is:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="CrystalReportViewerPage.aspx.cs"
      Inherits="WebPages_DynamicReports_CrystalReportViewerPage" %&gt;
  
  &lt;%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
      Namespace="CrystalDecisions.Web" TagPrefix="cr" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;CrystalReportViewer&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;cr:CrystalReportViewer ID="CrystalReportViewer1" runat="server" HasCrystalLogo="False" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My web.config file contains:</p>
  
  <pre><code>    &lt;sectionGroup name="businessObjects"&gt;
          &lt;sectionGroup name="crystalReports"&gt;
              &lt;section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/&gt;
          &lt;/sectionGroup&gt;
      &lt;/sectionGroup&gt;
  
          &lt;assemblies&gt;
              &lt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
              &lt;add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
              &lt;add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
              &lt;add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
              &lt;add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
          &lt;/assemblies&gt;
          &lt;buildProviders&gt;
              &lt;add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&gt;
          &lt;/buildProviders&gt;
  </code></pre>
  
  <p>And I have installed both <code>CRforVS_redist_install_64bit_13_0_2</code> and <code>CRforVS_redist_install_32bit_13_0_2</code> redistributables on my Windows 2008 R2 Datacenter server at different times and both have failed to resolve the issue. The application connects to an Amazon RDS SQL Server Instance, being on an Amazon EC2 instance itself.</p>
  
  <p>I've searched over the internet for some time to find the solution for this issue but apparently the Load Report Failed message is quite broad in its meaning, so I hope that I can solve this problem with help towards this particular instance of the issue.</p>
  
  <p>I have been stuck with this issue for over a week now so I would be grateful if any help can be offered.</p>