In my mvc project reports are deployed on separate SSRS server and we are loading the SSRS Reports with help of iframe, problem with this is its asking for user name and password while accessing the reports with iframes. To remove the user id ans password prompt I was trying to implement the solution provided on this link and I changed the code in ReportTemplate.aspx.cs file as below to send the credentials referring this link:
rvSiteMapping.Width = 800;
rvSiteMapping.Height = 600;
rvSiteMapping.ProcessingMode = ProcessingMode.Remote;
IReportServerCredentials irsc = new CustomReportCredentials(@"userid", "password", @"\");
rvSiteMapping.ServerReport.ReportServerCredentials = irsc;
rvSiteMapping.ShowCredentialPrompts = true;
rvSiteMapping.ServerReport.ReportServerUrl = new Uri("http://12.25.2.24/Reports");
rvSiteMapping.ServerReport.ReportPath = "/report/AssetDetail";
rvSiteMapping.ServerReport.Refresh();
I am getting below error:
The underlying connection was closed: An unexpected error occurred on a send. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host
However its working perfectly fine with below code:
rvSiteMapping.Width = 800;
rvSiteMapping.Height = 600;
rvSiteMapping.ProcessingMode = ProcessingMode.Local;
ReportsDataSet ds = new ReportsDataSet();
var connectionString = ConfigurationManager.ConnectionStrings["LowryATS_Tenant2ConnectionString"].ConnectionString;
SqlConnection conx = new SqlConnection(connectionString);
SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM Assets", conx);
adp.Fill(ds, ds.Assets.TableName);
rvSiteMapping.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"AssetReport.rdlc";
rvSiteMapping.LocalReport.DataSources.Add(new ReportDataSource("ReportsDataSet", ds.Tables[0]));
Can anybody please help me with this problem. We are using ssrs 2016 on ssrs server.