用于SQL报告服务的报告查看器的替代方法。

时间:2022-01-09 08:13:32

We're looking to develop an upgrade to our existing ASP.NET application in MVC3. Our current app is IE only based and the upgrade will be browser neutral, i.e. it must work in IE8+, firefox, chrome and safari.

我们希望对现有的ASP进行升级。在MVC3网络应用程序。我们目前的应用程序是基于IE的,升级将是中立的浏览器,也就是说它必须在IE8+, firefox, chrome和safari中运行。

The main issue we have is that we have a number of reports based on SQL Reporting Services 2008 R2 and we use the Report Viewer 2010 control.

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

We don't really want to use this going forward because:

我们并不想继续使用它,因为:

  • It's buggy (for example, we can't use the SP1 version as renders HTML sometimes that breaks our site)
  • 它是错误的(例如,我们不能使用SP1版本作为渲染HTML有时会破坏我们的站点)
  • It's got issues with non IE browsers (e.g. the IterationId missing on URL bug)
  • 它有一些非IE浏览器的问题(例如,URL错误中缺少IterationId)
  • It's based on Viewstate
  • 它是基于视图状态
  • It's hard to localise some of the rendered output of the control
  • 很难将控件的一些渲染输出本地化

I'd really like to replace it with an alternative (even if its viewstate based and we have to hack in a solution with MVC) but I've not been able to find one. Is there an alternative control out there that renders Reporting Services reports? It's the viewer we want to replace, not RS.

我真的很想用另一种方法来替换它(即使它是基于viewstate的,而且我们必须用MVC破解一个解决方案),但是我还没有找到。是否存在另一种控件来呈现报表服务报告?我们要替换的是查看器,而不是RS。

3 个解决方案

#1


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:

我们想将SSRS与现有的网站集成在一起,但不想使用SSRS UI(因为它是自己的网站),也不想使用报表视图控件(尽管我们有ASP)。NET网站,报表查看器控件有有限的选项让它做你想做的)。对我们有效的解决方案是:

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

    调用SSRS Web服务返回报告列表,并将值放入下拉列表。

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

    从下拉列表中读取报表路径,并获取SSRS Web服务,该服务返回所选报表的参数。

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

    基于#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.

    该页面将值传递给SSRS Web服务,并根据用户的请求获取PDF、Excel和Word文档。

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.

这并不难(代码和测试花费了不到40个小时),而且运行得非常好。我们最大的问题是当您从一个版本的SSRS Web服务迁移到另一个版本时,支持不同版本的SSRS Web服务。

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

我猜如果你想将报告输出为HTML并将其注入到UI中,你也可以这么做。

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

显然,如果您希望所有用户都编辑报表属性、创建订阅等,那么您将有更多的工作要做。

#2


0  

I agree with you. It is really a buggy control. I played with my DOCTYPE settings to tweak my html output.

我同意你的看法。这是一个错误的控制。我使用DOCTYPE设置来调整html输出。

If you can try commercial ones,have a look into Telerik control.

如果你可以试试商用的,看看Telerik控件。

Also look at this discussion:

还可以看看这个讨论:

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

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

#3


0  

You may be able to just view the HTML version and set the controls to be bound by the service in a REST URI instead. EG:

您可以只查看HTML版本,并将控件绑定到REST URI中的服务。例如:

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

I have never tried anything beyond hosting this in a 'Form' html object but I would wonder if you could get away just using a default html browser object and just forcing the REST URI to have conditions.

我从未尝试过在“表单”html对象中托管它,但我想知道您是否可以只使用默认的html浏览器对象,并强制其余的URI具有条件。

You may also if you really want to dive into VB.NET or C#.NET in your ASP.NET code. Maybe you can just render the byte array of Reporting Services to a type of PDF or HTML, then present that in a viewer as well. This may not be a viable solution as I am not sure of your level of wants to then try to present a binary object in a proprietary format versus just a web portion of an existing call. This may be more work and would be more tailored to a rendering of just that type you choose of PDF, Excel, HTML, etc. But it can be done. I basically made a library project with the logic to do the calls after making a proxy class out of the SSRS Service. More on that here: Programmatically Export SSRS report from sharepoint using ReportService2010.asmx

你也可以,如果你真的想潜水到VB。净或c#。净你的ASP。NET代码。也许您可以将报表服务的字节数组呈现给一种PDF或HTML类型,然后在查看器中也显示出来。这可能不是一个可行的解决方案,因为我不确定您的希望级别,然后尝试以私有格式呈现二进制对象,而不只是现有调用的web部分。这可能需要做更多的工作,并且更适合您选择的PDF、Excel、HTML等类型的呈现。我基本上做了一个库项目,在使用SSRS服务创建了一个代理类之后,用逻辑进行调用。更多信息请参见这里:使用ReportService2010.asmx从sharepoint以编程方式导出SSRS报告

#1


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:

我们想将SSRS与现有的网站集成在一起,但不想使用SSRS UI(因为它是自己的网站),也不想使用报表视图控件(尽管我们有ASP)。NET网站,报表查看器控件有有限的选项让它做你想做的)。对我们有效的解决方案是:

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

    调用SSRS Web服务返回报告列表,并将值放入下拉列表。

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

    从下拉列表中读取报表路径,并获取SSRS Web服务,该服务返回所选报表的参数。

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

    基于#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.

    该页面将值传递给SSRS Web服务,并根据用户的请求获取PDF、Excel和Word文档。

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.

这并不难(代码和测试花费了不到40个小时),而且运行得非常好。我们最大的问题是当您从一个版本的SSRS Web服务迁移到另一个版本时,支持不同版本的SSRS Web服务。

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

我猜如果你想将报告输出为HTML并将其注入到UI中,你也可以这么做。

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

显然,如果您希望所有用户都编辑报表属性、创建订阅等,那么您将有更多的工作要做。

#2


0  

I agree with you. It is really a buggy control. I played with my DOCTYPE settings to tweak my html output.

我同意你的看法。这是一个错误的控制。我使用DOCTYPE设置来调整html输出。

If you can try commercial ones,have a look into Telerik control.

如果你可以试试商用的,看看Telerik控件。

Also look at this discussion:

还可以看看这个讨论:

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

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

#3


0  

You may be able to just view the HTML version and set the controls to be bound by the service in a REST URI instead. EG:

您可以只查看HTML版本,并将控件绑定到REST URI中的服务。例如:

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

I have never tried anything beyond hosting this in a 'Form' html object but I would wonder if you could get away just using a default html browser object and just forcing the REST URI to have conditions.

我从未尝试过在“表单”html对象中托管它,但我想知道您是否可以只使用默认的html浏览器对象,并强制其余的URI具有条件。

You may also if you really want to dive into VB.NET or C#.NET in your ASP.NET code. Maybe you can just render the byte array of Reporting Services to a type of PDF or HTML, then present that in a viewer as well. This may not be a viable solution as I am not sure of your level of wants to then try to present a binary object in a proprietary format versus just a web portion of an existing call. This may be more work and would be more tailored to a rendering of just that type you choose of PDF, Excel, HTML, etc. But it can be done. I basically made a library project with the logic to do the calls after making a proxy class out of the SSRS Service. More on that here: Programmatically Export SSRS report from sharepoint using ReportService2010.asmx

你也可以,如果你真的想潜水到VB。净或c#。净你的ASP。NET代码。也许您可以将报表服务的字节数组呈现给一种PDF或HTML类型,然后在查看器中也显示出来。这可能不是一个可行的解决方案,因为我不确定您的希望级别,然后尝试以私有格式呈现二进制对象,而不只是现有调用的web部分。这可能需要做更多的工作,并且更适合您选择的PDF、Excel、HTML等类型的呈现。我基本上做了一个库项目,在使用SSRS服务创建了一个代理类之后,用逻辑进行调用。更多信息请参见这里:使用ReportService2010.asmx从sharepoint以编程方式导出SSRS报告