I have one remote server (ex: 192.168.8.8) and one local server. I can run the crystal report which is on my local server without any issue.
But When I try to run on my remote server, it throws Load Report Failed error.
Here is my code:
CrystalReport.cs
protected void CrystalReportViewer1_Init(object sender, EventArgs e)
{
ReportDocument _rdStudents = new ReportDocument();
string reportPath = Server.MapPath("~" + Request.QueryString["filename"].ToString());
//string reportPath = Request.QueryString["filename"].ToString();
_rdStudents.Load(reportPath);
CrystalReportViewer1.ReportSource = _rdStudents;
}
CrystalReport.aspx
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="js/jquery-3.1.1.js"></script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" Height="962px" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="1344px" HasRefreshButton="True" ToolPanelView="ParameterPanel" OnInit="CrystalReportViewer1_Init" />
</div>
</form>
</body>
</html>
My report location is //192.168.8.8/c$/inetpub/wwwroot/CrystalReportFiles/Test/Report1.rpt
I check with this crystal-reports-load-report-failed-error-running-report-on-the-server link.
I will not run the report directly using Report FileName attribute.
I tried with both category
string reportPath = Server.MapPath("~" + Request.QueryString["filename"].ToString()); //filename = /CrystalReportFiles/Test/Report1.rpt
string reportPath = Request.QueryString["filename"].ToString(); //filename=//192.168.8.8/c$/inetpub/wwwroot/CrystalReportFiles/Test/Report1.rpt
I gave access to c:\Windows\Temp to full control access for (IIS_IUSRS, USERS, Everyone)
I installed CRforVS_13_0_20
Update
I have CrystalReport.aspx file on my remote server also and my local server also
By passing parameter of file path(
//192.168.8.8/c$/inetpub/wwwroot/CrystalReportFiles/Test/Report1.rpt
) toCrystalReport.aspx
(local server). I can run reportBut I cannot run from
CrystalReport.aspx
which is on RemoteServer(192.168.8.8), by passing the same path