Can one use Reportviewer Control in ASP.net Core
Asked Answered
W

2

26

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.

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

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

Wilmerwilmette answered 9/3, 2016 at 11:32 Comment(0)
P
15

Update 2019

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.

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

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.


Original post:

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.

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.

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).

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.

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).

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 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'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).

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.

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).

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.

Phane answered 19/5, 2017 at 9:2 Comment(0)
C
3

Here is a report viewer works on both ASP.NET MVC and ASP.NET Core.

MVC .NET Core Report Viewer

Contentment answered 8/1, 2017 at 13:31 Comment(6)
The above implementation does not support local .rdlc files currently, and can only be used with server hosted SSRS reports.Vday
@Vday Still they not supporting local .rdlc files ?Highpriced
Microsoft acquires report rendering technology from Forerunner Software (April 2, 2018) so it seems that technology is our near future blogs.msdn.microsoft.com/sqlrsteamblog/2018/04/02/…Intuitive
By the way don't forget to vote for this feedback.azure.com/forums/908035-sql-server/suggestions/…Intuitive
Does anyone here have more info on RDLC rendering in .NetCore3.1 or .Net5? It seems like the MS blog above is pretty old but we haven't seen anything come of it yet.Marker
My business cannot function without it. Am I stuck with third party options?Gripe

© 2022 - 2024 — McMap. All rights reserved.