asp.net - 报表服务器凭据和丢失端点异常

标签 asp.net reporting-services reportviewer

实际上我需要的是一步一步的指南,但无论如何..

我必须使用 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/

相关文章:

ssrs-2008 - 为什么我在设置参数 "parameter is missing a value"或 "Hidden"后出现 "Internal"错误?

asp.net - 在 ASP.NET 4 ReportViewer 中使用对象数据源

.net - 为ReportViewer(rdlc)创建自定义导出到Excel

c# - 在 ReportViewer C# 中更改打印按钮的行为

asp.net - 在asp.net中提交表单

reporting-services - SSRS 中过滤器表达式的类型问题

asp.net - 不同端口的 SSL 证书

sharepoint-2010 - 在与 SSRS 集成模式下安装的 Sharepoint 2010 中禁用数据警报

javascript - 替换字符串中的下划线

asp.net - 如果 href 具有动态组件 asp.net,则不会显示 Facebook Like 按钮