Skip to Content
0
Former Member
May 29, 2014 at 03:42 PM

Load Report Failed - Server Only

356 Views

Hello,

I have an asp.net C# application hosted on an Amazon EC2 server. I am trying to select a report using:

ReportDocument rep;

protected void Page_Load(object sender, EventArgs e)

{

string reportPath = Server.MapPath((string)Utils.GetSessionNavigator(this).GetDataFromCurrentPage(PageParams.Reports.Report));

if (!IsPostBack)

{

rep = new ReportDocument();

}

try

{

if (!File.Exists(reportPath))

{

Response.Write("The specified report does not exist \n");

}

rep.Load(reportPath);

//LoadReport(rep);

rep.SetDatabaseLogon("******", "******");

this.CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;

this.CrystalReportViewer1.HasToggleGroupTreeButton = false;

this.CrystalReportViewer1.ReportSource = rep;

}

catch (Exception ex)

{

Response.Write(ex.Message);

}

}

private void Page_Unload(object sender, EventArgs e)

{

rep.Close();

rep.Dispose();

}

The report path is pointing towards my folder containing the reports, and the relevant file is being found with File.Exists, however upon using rep.Load, the exception message 'Load Report Failed" is being posted.

I have installed the correct runtimes as I have another application running on the same server, and that isn't having the same issues. Perhaps the reportPath is different but I am not sure.

Any advice would be greatly appreciated.

Thank you.