本文介绍了可以在ASP.net Core中使用Reportviewer控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在ASP.NET Core MVC项目中使用Reporting Services ReportViewer控件.

I want to make use of the Reporting Services ReportViewer control in an ASP.NET Core MVC project.

其他它以将网络表单添加到项目中.

The solution as proposed in other answers it to add a webform to the project.

但是,由于ASP.NET Core不支持Web表单,因此无法将控件添加到Web表单.

However since ASP.NET Core doesn't support webforms I cannot add the control to a webform.

还有其他解决方法可能会帮助我在ASP.NET Core Web应用程序中使用ReportViewer控件吗?

Is there any other workaround that might possibly assist me in using the ReportViewer control in an ASP.NET Core Web application?

推荐答案

更新2019

我让ReportViewer在Windows的ASP.NET Core上工作,并且大多数功能(不是PDF和Images/PowerPoint)也在Linux的ASP.NET Core上工作.
但是,仍有一些错误需要清除.
您可以在此github问题中了解更多信息.

I have ReportViewer working on ASP.NET Core on Windows, and most features (not PDF and Images/PowerPoint) also work on ASP.NET Core on Linux.
There's still some bugs to weed out, though.
You can learn more about it in this github issue.

我无法公开发布它,因为ReportViewer 具有相当严格的许可证 ...

I can't release it publicly, because ReportViewer has a rather constricting license...

它基于amh1979的 AspNetCore.Reporting nuget .
您也可以在amh1979之前尝试使用环绕ReportExecution.asmx的包装器nuget ,但没有许可问题,但这不是真正的ReportViewer.

It is based on the AspNetCore.Reporting nuget by amh1979.
You might try the wrapper nuget around ReportExecution.asmx, also by amh1979, this has no licensing issues, but it's no real ReportViewer.


原始帖子:

不,您不能.
Microsoft仅在评估创建.NET Core ReportViewer控件.
这意味着目前没有任何东西(05/2017).
ASP.NET MVC也没有任何ReportViewer控件".

No, you can't.
Microsoft is only just evaluating creating a .NET Core ReportViewer control.
Which means there isn't any at present (05/2017).
There also isn't any ReportViewer "control" for ASP.NET MVC.

在MS-ReportServer的ReportExecution.asmx周围只有 alanjuden的包装器.
但这不一样.这仍然需要报表服务器上的Windows身份验证(以及用户必须是特定广告组的成员)以及在Windows上运行的SSRS服务器.

There is only alanjuden's wrapper around MS-ReportServer's ReportExecution.asmx.
But that isn't the same. That will still require Windows Authentication on the report server (along with user-must-be-member-of-specific-ad-group), and a SSRS server running on Windows.

如果您在Windows上仍然拥有SSRS-ReportServer,则最好将SSRS ReportViewer.aspx嵌入到iframe中.您可能要向您的报表服务器添加表单身份验证.另外,如果需要跨平台(=跨浏览器=非IE),则需要SSRS> = 2016(跨浏览器在SSRS 2005/2008R1/2008R2/2012/2014中不可用).

If you anyway have an SSRS-ReportServer on Windows, you're much better of embedding SSRS ReportViewer.aspx in an iframe. You might want to add forms-authentication to your reportserver. Also, if it needs to be cross-platform (=cross-browser = non-IE), you need SSRS >= 2016 (cross-browser not available in SSRS 2005/2008R1/2008R2/2012/2014).

如果您使用的是Windows,并且不想(您的客户)必须安装特定版本的SSRS(这意味着您必须许可MS-SQL-Server),则可以创建一个.NET非- IIS上的Web应用程序(在同一域上),并共享auth-cookie.然后,您可以通过.NET Core Web应用程序中的iframe(或与target = _blank链接)从IIS .NET非核心应用程序中嵌入该ReportViewer.这样,您就不需要SQL Server许可证,例如,如果您使用MySQL/PostgreSQL/Oracle,就不需要MS-SQL-Server.

If you're on Windows and don't want (your customer) to have to install a specific version of SSRS (which means you have to license a MS-SQL-Server), you can create a .NET non-core web application on IIS (on the same domain), and share the auth-cookie. Then you embed that ReportViewer from the IIS .NET non-core application via iframe (or link with target=_blank) in your .NET Core Web-Application. That way you don't require an SQL-Server license, and no MS-SQL-Server if you, for example, use MySQL/PostgreSQL/Oracle.

除了等待,您可以将带有BIRT的Apache Tomcat捆绑到您的应用程序中,然后.然后,您只需要使用Eclipse-BIRT ReportDesigner创建BIRT报告(非SSRS报告).

Other than wait, you can bundle Apache Tomcat with BIRT into your application, and use Launch4J to redistribute it with the JRE. Then you'll just have to use the Eclipse-BIRT ReportDesigner to create BIRT reports (non-SSRS-reports).

或者您可以将JasperReports嵌入JasperServer.
bin部署比BIRT困难得多.
但是我想码头工人可以解救.

Or you can embed JasperReports with JasperServer.
This would be far more difficult to bin-deploy than BIRT.
But I guess docker to the rescue.

Jasper和BIRT的优势在于它们也可以在Linux/Mac上运行.
但是,这意味着您要么需要在服务器上安装JRE,要么将JRE与您的应用程序一起进行bin-deploy.

Jasper and BIRT have the advantage that they also run on Linux/Mac.
However, that means you either need the JRE installed on the server, or bin-deploy the JRE along with your application.

Jasper与BIRT相比的优势在于它速度更快,并且支持垂直文本(不仅在网络中,而且垂直文本也不呈现为图像).

Jasper's advantage over BIRT is that it is faster, and that it supports vertical text (not just in the web, and vertical-text is not rendered as image).

通常从其网站下载的BIRT版本始终存在问题,这些问题一开始会阻止BIRT的运行.是缺少的JAVA_HOME环境变量,缺少的.jar依赖关系还是.jar文件中的无效签名.有关您的计算机上将要使用的内容的信息,请查阅TOMCAT日志文件,然后搜索问题.
BIRT的优点是,bin部署相对容易.

There usually are always issues with the BIRT releases downloaded from their website that prevent running BIRT at first. Be that a missing JAVA_HOME environment variable, a missing .jar-dependency or an invalid signature in a .jar file. For information on what it will be on your machine at your time, consult the TOMCAT logfiles, and then google the problem.
The nice thing about BIRT is, that it's comparatively easy to bin-deploy.

如果您喜欢nodeJS,另一个选项是jsReports.
但是,在没有安装和复杂性的情况下进行Bin-Deploy会更加困难(PhantomJS,Webkit,wkHtmlToPdf-例如,在Raspberry PI上使用ARM处理器).

Another option would be jsReports, if you like nodeJS.
However, Bin-Deploy that without installation and complications will be even harder (PhantomJS, Webkit, wkHtmlToPdf - for example with an ARM-processor on Raspberry PI).

如果您还有几年的时间,也可以等到SSRS团队移植到.NET Core时-就是这样.

If you have a few years to spare, you can also just wait until the SSRS team ports to .NET Core - if that happens at all, that is.

这篇关于可以在ASP.net Core中使用Reportviewer控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

查看更多