RDLC Local report viewer for ASP.NET Core and Angular(>2.0)
Microsoft is not implementing or bringing RDLC report viewer into aspnet core. Instead they are purchasing a product to fill the void.
Full link to news - https://blogs.msdn.microsoft.com/sqlrsteamblog/2018/04/02/microsoft-acquires-report-rendering-technology-from-forerunner-software/
Link to original issue - https://github.com/aspnet/Home/issues/1528
Here is the essence. "Microsoft acquires report rendering technology from Forerunner Software
We’re pleased to announce that we’ve acquired technology from Forerunner Software to accelerate our investments in Reporting Services. This technology includes, among other things, client-side rendering of Reporting Services (*.rdl) reports, responsive UI widgets for viewing reports, and a JavaScript SDK for integrating reports into other apps – a testament to what our partners can achieve building on our open platform.
This is great news for you, as we see opportunities to apply this technology to multiple points of feedback we’ve heard from you:
You’re looking for cloud Software-as-a-Service (SaaS) or Platform-as-a-Service (PaaS) that can run SSRS reports. As you might’ve seen in our Spring ’18 Release Notes, we’re actively working on bringing SSRS reports to the Power BI cloud service, and we’re building on client-side rendering to make that possible. You want to view SSRS reports on your phone, perhaps using the Power BI app. We believe this technology will help us deliver better, more responsive UI for supplying report parameter values, navigating within reports, and possibly even viewing report content.
You love the Report Viewer control… but it’s an ASP.NET Web Forms control. You need something you can integrate into your ASP.NET Core/MVC app or non-ASP.NET app. With this technology, we hope to deliver a client-side/JavaScript-based Report Viewer you can integrate into any modern app.
These are large undertakings and we don’t yet have timeframes to share, but stay tuned over the coming months as we always strive to share our progress with you and hear your feedback as early and often as we can.
Forerunner Software will continue to support existing customers for a limited period of time."
In order for Jame's solution to work - it requires that you reference the full .NET Framework. This is all well and good for ASP.NET Core 1 and 2, however - as everyone should be aware by now - ASP .NET 3 will NOT allow you to reference the full .NET Framework.
Currently, it's only possible to use SSRS hosted server reports (RDL) reports with .NET Core. For client RDLC reports, currently only the paid Syncfusion solution works (I've tested the trail version)
James solution will is entirely invalid with ASP.NET Core 3 (which again - only allows you to reference .NET Core - not the .NET Framework)
If the question is how to use Microsoft Reportviewer on ASP.NET Core project, regardless of implementation details, my solution is to bypass the actual reportviewer control and render reports directly to PDF or Excel. It works in .net Core 1.1. NuGet package we use is Microsoft.ReportViewer.2012.Runtime by Fornax.
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Reporting.WebForms;
namespace WebApplication3.Controllers
{
public class ReportController : Controller
{
private readonly IHostingEnvironment environment = null;
public ReportController(IHostingEnvironment environment)
{
this.environment = environment;
}
public IActionResult Report()
{
string mimeType;
string encoding;
string filenameExtension;
string[] streams;
Warning[] warnings;
var rv = new ReportViewer();
rv.ProcessingMode = ProcessingMode.Local;
rv.LocalReport.ReportPath = Path.Combine(environment.ContentRootPath, "Reports", "Report1.rdlc");
rv.LocalReport.Refresh();
var bytes = rv.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streams, out warnings);
return File(bytes, mimeType);
}
}
}