【问题标题】:How to use web service methods in ssrs?如何在 ssrs 中使用 Web 服务方法?
【发布时间】:2013-08-09 07:22:33
【问题描述】:

我是 SSRS 的新手,我创建了一个 Web 服务,该服务具有一种方法,该方法采用字符串值并返回该值方法的条形码图像如下

Image BarcodeText(string textToBarcode,int barcodeWeight,bool isMargin)

我想在我的 SSRS 报告中从图像框表达式中的 Web 服务调用此方法,并将值传递给我不知道如何从 Web 服务调用方法的方法.我从网络服务搜索了访问方法,但没有任何帮助,因此任何链接或任何描述都会真正有帮助,

1) How to reference web service in the report ?
2) How to call method from web service and pass the parameters to the method ?

提前致谢。

【问题讨论】:

    标签: c# web-services reporting-services ssrs-2008 reportingservices-2005


    【解决方案1】:

    前段时间我遇到了同样的问题,所以我解决了这个问题,我希望这对你也有用。

    1) 首先,我使用创建的 Web 服务的服务引用创建了 Web 应用程序,假设 Barcode39 是服务,因此添加对 Web 应用程序的引用。 2)然后使用服务客户端编写代码并调用该方法通过传递请求变量值在该代码中创建条形码图像 3) 现在将该页面的链接作为图像表达式的 URL,同时将图像类型设置为“EXTERNAL”,并将值作为请求变量传递给 URL

     "http:\\localhost:2310\BarcodeImage.aspx?data=" +(Parameters!YourParamtere.Value)
    

    还有一件事,而不是从服务返回图像,尝试使用 stream.ToArray() 方法返回字节数组,这将是最佳实践。如果有任何问题,请告诉我。

    【讨论】:

      【解决方案2】:

      http://technet.microsoft.com/en-us/library/aa964129.aspx

      此网页为您提供从 SSRS 访问网络服务所需的所有信息。

      【讨论】:

        猜你喜欢
        • 2014-05-13
        • 2011-03-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多