从Reporting Services中的MVC应用程序(DLL)重用业务逻辑

时间:2021-08-15 08:24:46

I have a business object that compiles into a DLL that handles all calculations for my system for concepts such as eligibility, etc. The object also handles the connectivity to the DB via some wrappers around it.

我有一个业务对象,编译成一个DLL,处理我的系统的所有计算,如资格等概念。该对象还通过它周围的一些包装器处理与DB的连接。

Is there anyway to take this .NET DLL and use it as a datasource for a reporting services report (SSRS)? We don't want to have the logic in multiple places.

无论如何都要使用这个.NET DLL并将其用作报告服务报告(SSRS)的数据源?我们不希望在多个地方拥有逻辑。

EDIT
What about exposing the functionality in a webservice in the web app itself and having the report connect to the web service? Anyone done this before? We are using asp.net MVC for our web app if that helps.

编辑如何在Web应用程序本身中公开Web服务中的功能并将报表连接到Web服务?有人这样做过吗?如果有帮助,我们正在使用asp.net MVC作为我们的网络应用程序。

3 个解决方案

#1


Your probably going to have to do this with the Report Viewer Control, as I have not ever seen an example using the reporting web service.

您可能必须使用Report Viewer Control执行此操作,因为我从未见过使用报表Web服务的示例。

http://www.gotreportviewer.com/

Here is the section on using Object data sources:

以下是使用对象数据源的部分:

http://www.gotreportviewer.com/objectdatasources/index.html

These can be conceptually similar to ViewModels in MVC, so you would have to build ReportViewModels™ to handle reporting requirements.

这些可以在概念上类似于MVC中的ViewModel,因此您必须构建ReportViewModels™来处理报告要求。

#2


Not overly familiar with SSRS but I would imagine it would be able to consume XML web services.

不太熟悉SSRS但我想它能够使用XML Web服务。

If this is the case you could use the underlying data and logic and expose it as HTML for the web site and XML for SSRS.

如果是这种情况,您可以使用基础数据和逻辑,并将其公开为网站的HTML和SSRS的XML。

#3


There are two ways to get your data to the report: WebServices and Custom Data Processing. there is an excellent book to get you started: http://prologika.com/Books/0976635313/Book.aspx

有两种方法可以将数据提供给报告:Web服务和自定义数据处理。有一本很棒的书可以帮助你入门:http://prologika.com/Books/0976635313/Book.aspx

After reading the related chapters I was able to easily use both techniques.

阅读相关章节后,我能够轻松使用这两种技术。

#1


Your probably going to have to do this with the Report Viewer Control, as I have not ever seen an example using the reporting web service.

您可能必须使用Report Viewer Control执行此操作,因为我从未见过使用报表Web服务的示例。

http://www.gotreportviewer.com/

Here is the section on using Object data sources:

以下是使用对象数据源的部分:

http://www.gotreportviewer.com/objectdatasources/index.html

These can be conceptually similar to ViewModels in MVC, so you would have to build ReportViewModels™ to handle reporting requirements.

这些可以在概念上类似于MVC中的ViewModel,因此您必须构建ReportViewModels™来处理报告要求。

#2


Not overly familiar with SSRS but I would imagine it would be able to consume XML web services.

不太熟悉SSRS但我想它能够使用XML Web服务。

If this is the case you could use the underlying data and logic and expose it as HTML for the web site and XML for SSRS.

如果是这种情况,您可以使用基础数据和逻辑,并将其公开为网站的HTML和SSRS的XML。

#3


There are two ways to get your data to the report: WebServices and Custom Data Processing. there is an excellent book to get you started: http://prologika.com/Books/0976635313/Book.aspx

有两种方法可以将数据提供给报告:Web服务和自定义数据处理。有一本很棒的书可以帮助你入门:http://prologika.com/Books/0976635313/Book.aspx

After reading the related chapters I was able to easily use both techniques.

阅读相关章节后,我能够轻松使用这两种技术。