7

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.

Cedric Mendelin
  • 172
  • 1
  • 2
  • 9
  • just updated the original question, hopefully it helps to understand the problem. In general i just want to know if it is possible to run a .rdl File in a asp.net core mvc application and create a pdf from it. – Cedric Mendelin Sep 26 '18 at 09:08

3 Answers3

8

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.

Cedric Mendelin
  • 172
  • 1
  • 2
  • 9
2

No you can't include System.Web. I had same problem and solved it with AspNetCore.Reporting. You can download this from NuGet. This can be useful: https://www.dotnetcurry.com/aspnet/844/aspnet-ssrs-reports-programmatically-html

Mr.No
  • 83
  • 9
0

Well, depends. If you want it inside your application, and don't mind generating the report in iframe it's possible. Or you can always open it in a new tab. Only problem is that you have to know the link to the report. I did it like that in my company's program. If you want to know more, just ask me, but officially ASP.NET Core doesn't support reporting