问题描述
我想在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报告).
或者您可以将JasperReports嵌入JasperServer.
bin部署比BIRT困难得多.
但是我想码头工人可以解救.
Jasper和BIRT的优势在于它们也可以在Linux/Mac上运行.
但是,这意味着您要么需要在服务器上安装JRE,要么将JRE与您的应用程序一起进行bin-deploy.
Jasper与BIRT相比的优势在于它速度更快,并且支持垂直文本(不仅在网络中,而且垂直文本也不呈现为图像).
如果您还有几年的时间,也可以等到SSRS团队移植到.NET Core时-就是这样.
这篇关于可以在ASP.net Core中使用Reportviewer控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!