【发布时间】:2011-10-19 20:19:42
【问题描述】:
其实我需要的是一步一步的指南,但无论如何..
我必须使用 ASP.NET 报告视图在网站中显示一些 rdl 报告,并为 Reporting Services 进行所有必要的配置。该页面的用户不应处理任何授权。
这是我的报告查看器代码:
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 中的配置文件有关,但我不知道在其中写什么。非常感谢任何帮助!
【问题讨论】:
标签: asp.net reporting-services reportviewer