实际上我需要的是一步一步的指南,但无论如何..
我必须使用 ASP.NET 报告 View 在网站中显示一些 rdl 报告,并为报告服务执行所有必要的配置。该页面的用户不应处理任何授权。
这是我的报告查看器代码:
rprtView.ServerReport.ReportServerCredentials = new ReportServerCredentials();
rprtView.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
rprtView.ServerReport.ReportServerUrl = new Uri(@"http://mydomain/reports");
rprtView.ServerReport.ReportPath = @"/MyReports/PurchaseOrder";
rprtView.ShowParameterPrompts = false;
ReportParameter[] parameters = new ReportParameter[1];
parameters[0] = new ReportParameter();
parameters[0].Name = "OrderNumber";
parameters[0].Values.Add(orderNumber);
rprtView.ServerReport.SetParameters(parameters);
rprtView.ServerReport.Refresh();
这是我的 IReportServerCredentials 重载
public class ReportServerCredentials : IReportServerCredentials
{
public bool GetFormsCredentials(out Cookie authCookie, out string userName, out string password, out string authority)
{
authCookie = null;
userName = password = authority = null;
return false;
}
public WindowsIdentity ImpersonationUser
{
get { return null; }
}
public ICredentials NetworkCredentials
{
get { return new NetworkCredential("myUserName", "myPassword"); }
}
}
我可以使用“myUserName”和“myPassword”登录“http://mydomain/reports”,即 SSRS 的默认网站(我不确定这是否相关)。我仍然在上面的 SetParameters() 方法中遇到 MissingEndPoint 异常。它说:
“尝试连接到报表服务器失败。请检查您的连接信息以及报表服务器是否为兼容版本。”
我还负责配置 Reporting Services,以实现此方案的必要配置,我听说此问题与 SSRS 中的配置文件有关,但我不知道在其中写入什么内容。非常感谢任何帮助!
最佳答案
为 rprtView.ServerReport.ReportServerUrl 提供的字符串应该用于报表服务器服务,而不是报表管理器应用程序。
更改此:
rprtView.ServerReport.ReportServerUrl = new Uri(@"http://mydomain/reports");
对此:
rprtView.ServerReport.ReportServerUrl = new Uri(@"http://mydomain/reportserver");
This page提供有关报表管理器界面、报表服务器 Web 服务以及它们之间的关系的一些高级信息。
关于asp.net - 报表服务器凭据和丢失端点异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7827603/