本文介绍了ASP.NET Core MVC应用程序中的Microsoft LocalReport(rdl)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET Core(2.1)MVC运行一个项目.在我们公司中,我们确实使用SQL Report Builder(rdlc和rdl文件)完成了许多工作.因此,我们希望在asp.net核心mvc webapp中使用一次性"机制和ReportBuilder技术生成PDF文件.

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.

我尝试了与.net Framework中使用的相同的nuget程序包(asp.net API和桌面应用程序),但它们无法正常工作.我尝试过的软件包是:

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

问题在于他们使用的是System.Web,我无法将其包含在.net Core应用程序中,对吗?

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

我用Google搜索了所有解决方案,但没有找到很多有用的材料.我也意识到微软购买了一种产品来完成工作: https://blogs.msdn.microsoft.com/sqlrsteamblog/2018/04/02/microsoft-acquires-report-rendering-technology-from-forerunner-software/

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/

我已经阅读了有关类似问题的这篇文章: RDASP的ASP.NET Core和角(> 2.0)

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

我们是否记错了技术设置,或者甚至根本不支持这种设置.我找到了其他一些软件包( https://www.nuget.org/packages/AlanJuden. MvcReportViewer.NetCore/)与html一起使用以呈现报告.但是我们真的要使用rdl文件

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.

推荐答案

最后,我们提出了一种完全不同的方法.

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

我们刚刚在Windows Server上作为服务运行的.NET Framework上创建了一个名为"DocumentService"的新应用程序.该服务正在检查数据库队列中是否有新作业,如果存在,它将生成pdf结果并将其存储在数据库中.

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.

因此,Web应用程序不再负责创建pdf,它仅在数据库中添加了新行,因此标记为应创建新文档.然后,DocumentService应用程序生成了文档,Web应用程序可以访问数据库中的数据.

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.

我们可以在我们的应用程序环境的其他部分使用此"DocumentService",因此effor是值得的.它的应用程序也是多线程的,并且可以快速,良好地工作.

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.

这篇关于ASP.NET Core MVC应用程序中的Microsoft LocalReport(rdl)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 07:15