我正在尝试使用C#连接到ssrs,我编写了以下代码:
string UserId = Session["UserId"].ToString();
MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
IReportServerCredentials irsc = new CustomReportCredentials("username", "mypassword", "mydomainname");
MyReportViewer.ServerReport.ReportServerCredentials = irsc;
MyReportViewer.ServerReport.ReportServerUrl = new Uri("my Report Server URL"); // Report Server URL
MyReportViewer.ServerReport.ReportPath = "/Attendance_Reports/Employee02"; // Report Name
ReportParameter p = new ReportParameter("ReportUser", UserId);
MyReportViewer.ServerReport.Timeout = 200000000;
this.MyReportViewer.ServerReport.SetParameters(new ReportParameter[] { p });
MyReportViewer.ShowPrintButton = true;
MyReportViewer.ShowBackButton = true;
MyReportViewer.ShowRefreshButton = true;
MyReportViewer.ShowReportBody = true;
MyReportViewer.ShowParameterPrompts = true;
但我收到此错误
无法建立连接,因为目标计算机主动拒绝了它197.50.102.166:443
如何阻止呼叫端口443并仅呼叫端口80?
答案 0 :(得分:0)
我发现this answer对类似问题很有帮助。
“ ReportServerUrl”属性应设置为SSRS Web服务URL,而不是报告管理器URL。这意味着您不应使用通常在配置报告时配置为http://<reportserver>/reports
的浏览报告时浏览的URL,而应使用http://<reportserver>/reportserver
之类的东西。