3

我们需要在报告中使用 WCF 作为数据源。[服务器模式]

点网 4.0/SSRS 2008 R2/ASP.Net 4.0

这背后的想法是在从报告到标准应用程序网格的整个应用程序中应用通用业务规则。

从本质上讲,它会按照以下方式工作

通常如下

[RDL - SQL 服务器数据提供程序 - 数据库]

但我们需要的是

[RDL - XML/自定义数据提供者 - WCF 方法 - 业务层 - - DB]

我们的主应用程序也将使用 WCF 层。实际上,出于实际目的,它是一个接口层,所以如果我们不得不使用 SSRS 的 Web 服务,那么会考虑这种方法是否有优势。

我发现了一些关于我们方法的文章

http://weblogs.asp.net/jezell/archive/2008/02/21/using-wcf-endpoints-with-sql-reporting-services.aspx

http://www.codeproject.com/Articles/37270/Consuming-a-WCF-Service-from-an-SSRS-RDL-Server-Re

http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/aa0c8c5e-28a7-440f-a1c1-62e8bb184b8d/

http://msdn.microsoft.com/en-us/library/ms154655(v=sql.105).aspx

http://devblog.bardoloi.com/2011/09/using-wcf-web-services-as-data-source.html

http://msdn.microsoft.com/en-us/library/aa964129(SQL.90).aspx

考虑到这里的限制,无论哪种方式

http://msdn.microsoft.com/en-us/library/aa964129(SQL.90).aspx#repservxmlds_topic5 这一切都变得有点可怕。

我不想做的当然是走上一条特定的道路,这会影响报告设计能力、性能,并可能限制可以创建的报告类型。

如果有人对上述布局有任何意见或经验,我将不胜感激您的意见和投入。

我也非常愿意接受可能的替代方案,即我们如何创建包含数据的报告,这些数据已经通过业务层进行适当的数据按摩等

为长篇道歉。

利亚姆

4

2 回答 2

3

我现在也在考虑同样的情况。自从提出这个问题以来已经有一段时间了,但我会为任何对此场景感兴趣的人添加这个。

So far it's not worth the effort, getting SSRS to interact with our WCF service takes too long and has several restrictions, most of them are outlined in the links you provided.

Here are the two alternatives I'm now contemplating

  1. Call the service before the report and pass the output as a parameter (the report has to parse the XML which is another issue)
  2. Call the service and convert its output to a more tabular format (after all the dataset is a table) convert to XML and send it to the report as a parameter (also need to be parsed but it could be easier than the original output as is in our case)
  3. Create a custom dataset extension that is more suitable to handle WCF calls and gives you greater control over the process.

All in all, I'm in a tight spot regarding this issue since there's no easy way to acomplish this out of the box.

Hope this helps anyone!

于 2012-08-14T16:15:07.360 回答
2

This is our solution and it worked quiet well for us so far. There is a lot of work involved though.

Option 3 in the answer that Carlos provided was the direction we had to take when we encountered issues with transferring a lot of Data through the WCF layer for large reports.

Essentially the Custom Data Processing Extension makes the calls to the WCF layer and in the event that the amount data that is returned is large (over a certain threshold) then this data is cached and we return to the Custom Data Processing Extension an indicator of the amount of calls that required to retrieve all the data.

We then make the required amount of calls.

So for 1/2 million records we may need 20 calls to the WCF with each call appending the data to the SSRS dataset.

The report viewer displays without issue the data 11,000 + pages but in order to export to Excel we need to run it on SSRS 2012.

Exporting > 500,000 records to Excel can take 10 mins. Opening the Excel file actually takes longer. :)

于 2012-10-17T12:41:11.617 回答