Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft LocalReport (rdl) in ASP.NET Core MVC App

I am running a project with ASP.NET Core (2.1) MVC. In our company we do have a lot of work done with SQL Report Builder (rdlc and rdl files). Therefore we wanted to use a "one the fly" mechanism to generate PDF Files with the ReportBuilder technology in the asp.net core mvc webapp.

I tried the same nuget packages we are using in .net Framework (asp.net API and desktop app) but they are not working. The packages I tried are:

  • Microsoft.ReportingServices.ReportViewerControl.Winforms
  • Microsoft.ReportingServices.ReportViewerControl.Webforms

The problem there is that they are using System.Web which I cannot include in .net Core apps, do I?

I googled for any solution but did not find a lot of helpfull material. I am also ware of that Microsoft purchased a product to get the work done: https://blogs.msdn.microsoft.com/sqlrsteamblog/2018/04/02/microsoft-acquires-report-rendering-technology-from-forerunner-software/

And I already read this article about a similar problem: RDLC Local report viewer for ASP.NET Core and Angular(>2.0)

Do we have the wrong technology setup in mind or is this even not support at all. I found some other package (https://www.nuget.org/packages/AlanJuden.MvcReportViewer.NetCore/) which are working with html to render a report. But we really want to use the rdl files

Any informations and suggestions are greatly appreciated.

like image 266
Cedric Mendelin Avatar asked Sep 26 '18 08:09

Cedric Mendelin


People also ask

How can create report in ASP NET MVC?

For creating a report, right click on Reports folder > Add > New Item > Select Reporting. Here, we have three components. Select Report, finally click Add. After clicking on Add, new window will pop up.

What is Report Viewer?

The Report Viewer allows users to open, view, manage, run, refresh, print, email, and export their Crystal Reports . RPT and RPTR files.


1 Answers

In the end we came up with a totally other approach.

We just created a new Application called "DocumentService" on .NET Framework running as a Service on a Windows Server. The service was checking a database if there are new jobs in the database queue and if so, it generates the pdf result and stores it in the database.

So the web application was not longer responsible for creating the pdf, it only added a new line in the database so mark that a new document should be created. The DocumentService app then generated the document and the web app could access the data in the database.

We can use this "DocumentService" in other part of our application landscape and therefore the effor was worth it. It app is also multithreaded and working pretty fast and well.

like image 133
Cedric Mendelin Avatar answered Sep 23 '22 10:09

Cedric Mendelin