【问题标题】:Passing parameters to service by URL - How do I discover the parameter names?通过 URL 将参数传递给服务 - 如何发现参数名称?
【发布时间】:2010-03-04 17:04:52
【问题描述】:

我有一份只有执行权限的报表 - 我无权访问 RDL 文件。此报告公开了几个我想从 URL 设置的参数。

我已经使用标准的 param=data 形式成功地更改了一些参数(如下所述:http://msdn.microsoft.com/en-us/library/ms153586.aspx)。但是,某些参数没有相同的参数提示和参数名称。

不幸的是,要通过 URL 传递参数值,我必须知道参数的名称,而且我不知道如何从报告及其参数提示文本中扣除。我试图检查源数据和后期数据,但无济于事。

有人有想法吗?

谢谢

P.S 我也偶然发现了这个:http://odetocode.com/Articles/123.aspx。但是,我无法连接到报表服务器的 Web 服务。

【问题讨论】:

    标签: reporting-services


    【解决方案1】:

    呃。我在回复自己,希望有人可以借鉴:

    我最终做到了,使用 herehere 所述的 Reporting Services Web 服务。这里要记住的一点是,服务的名称已更改(我相信从 SQL Server 2005 起)端点是 ReportService2005.asmx

    添加网络参考后,我仍然遇到各种问题。总而言之,这是最终为我工作的代码(注意:我在域中,我连接的 IIS 需要域窗口身份验证)。

        ReportParameter[] parameters;
        const string historyId = null;
        const bool forRendering = true;
        ParameterValue[] values = null;
        DataSourceCredentials[] credentials = new DataSourceCredentials[] {};
    
        ReportingService2005SoapClient c = new ReportingService2005SoapClient();
        c.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("USERNAME", "PASSWORD", "DOMAIN"); 
        c.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
    
        c.GetReportParameters
        (
            "/CycleStatus/Builds Score",
            historyId,
            forRendering,
            values,
            credentials,
            out parameters
        );
    

    但是,我被以下错误所困扰:

    “HTTP 请求未通过客户端身份验证方案‘匿名’进行授权。从服务器接收到的身份验证标头为‘Negotiate,NTLM’”

    要处理您需要更改的问题,请在 app.config 中更改安全节点,如下所示:

    <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" />
    </security>
    

    之后一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      • 2013-12-13
      • 1970-01-01
      • 2022-01-22
      • 2023-03-14
      • 2022-08-19
      • 1970-01-01
      相关资源
      最近更新 更多