SQL Reporting Services的报表查看器的替代方法

时间:2011-11-07 19:50:42

标签: sql-server reporting-services reportviewer

我们正在寻求在MVC3中开发对现有ASP.NET应用程序的升级。我们当前的应用程序仅基于IE,升级将是浏览器中立的,即它必须适用于IE8 +,firefox,chrome和safari。

我们遇到的主要问题是我们有许多基于SQL Reporting Services 2008 R2的报告,我们使用Report Viewer 2010控件。

我们真的不想使用这个,因为:

  • 这是错误的(例如,我们不能使用SP1版本来呈现HTML 有时会破坏我们的网站)
  • 非IE浏览器存在问题(例如,缺少IterationId) 网址错误)
  • 它基于Viewstate
  • 很难本地化控件的某些渲染输出

我真的想用替代品取代它(即使它的基于视图状态,我们必须破解MVC的解决方案),但我找不到一个。是否有一个替代控件可以呈现Reporting Services报告?这是我们想要替换的观众,而不是RS。

3 个答案:

答案 0 :(得分:2)

We wanted to integrate SSRS with out existing website but didn't want to use the SSRS UI (since it's very much it's own website) and we didn't want to uses the Report View Controls (although we have an ASP.NET Website, the report viewer controls have limited options for making it do what you want). The solution that worked for us was:

  1. Call the SSRS Web Service to return a list of Reports, and drop the values into a Drop Down List.

  2. Read the report path from the Drop Down List and get the SSRS Web Service that returns the parameters of the selected report.

  3. Build input controls based on what came back in #2.

  4. Users supply the input values and submit the form.

  5. The page passes the values to the SSRS Web Service and gets back a PDF, Excel, Word document based on what the user requested.

This wasn't all that hard (it took < 40-hours to code & test) and works really well. The biggest issue we have is supporting different versions of the SSRS Web Service as you move from one version of SSRS to another.

I'm guessing if you wanted to output the reports as HTML and pump that to the UI, you could do that too.

Obviously if you want to all users to edit report properties, create subscriptions, etc -- you'll have additional work to do.

答案 1 :(得分:0)

我同意你的看法。这真是一个有缺陷的控制。我使用我的DOCTYPE设置来调​​整我的html输出。

如果您可以试用商业广告,请查看Telerik控件。

另见这个讨论:

http://siddhumehta.blogspot.com/2011/07/ssrs-reportviewer-webpart-control.html

答案 2 :(得分:0)

您可以只查看HTML版本,并将控件设置为由REST URI中的服务绑定。 EG:

http:// (servername)/(ReportServer)/(PathtoReport)&(Parameter=Value)&rs:Command=Render

我从来没有尝试过在'Form'html对象中托管它之外的任何东西,但我想知道你是否可以使用默认的html浏览器对象而只是强迫REST URI有条件。

如果你真的想在ASP.NET代码中深入研究VB.NET或C#.NET,也可以。也许您只需将Reporting Services的字节数组呈现为PDF或HTML类型,然后将其呈现在查看器中。这可能不是一个可行的解决方案,因为我不确定您是否希望以专有格式呈现二进制对象而不仅仅是现有调用的Web部分。这可能是更多的工作,并且更适合于渲染您选择的PDF,Excel,HTML等类型。但它可以完成。我基本上创建了一个库项目,其逻辑是在从SSRS服务中创建代理类之后进行调用。更多内容如下: Programmatically Export SSRS report from sharepoint using ReportService2010.asmx