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

与世无争的帅哥 提交于 2020-01-04 07:28:08

问题


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.


回答1:


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.




回答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




回答3:


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



来源:https://stackoverflow.com/questions/52513800/microsoft-localreport-rdl-in-asp-net-core-mvc-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!