简体   繁体   English

C#类库和报表

[英]C# Class library and Reporting

I am building a big system, which i have divided in three tiers, UI, Class-Library, and Database. 我正在构建一个大型系统,该系统分为三层:UI,类库和数据库。 Database stores all data only, and Class-Library provides all functionalities and business logic. 数据库仅存储所有数据,而类库提供所有功能和业务逻辑。 And UI is the User-Interface. UI是用户界面。

The issue which i face is: how to integrate the reporting in this situation. 我面临的问题是:在这种情况下如何整合报告。 I am using C# for class-library, and windows-forms-in-C# for UI. 我将C#用于类库,将Windows-forms-in-C#用于UI。 I intend to use rdlc Microsoft reports. 我打算使用rdlc Microsoft报告。

My strategy at this point is: Let every object add its own data in a dataset, which will be then returned to the UI for display in report. 我现在的策略是:让每个对象在数据集中添加自己的数据,然后将其返回到UI以显示在报表中。

It seems to me that the reports are just another UI. 在我看来,这些报告只是另一个UI。 Your business logic for what data to return for a given report should live in the class library. 您对于给定报告要返回哪些数据的业务逻辑应该存在于类库中。 The reporting business objects would probably live in a namespace of their own (Appname.Reporting). 报告业务对象可能位于其自己的名称空间(Appname.Reporting)中。 I think I would have an abstract report class that provides a skeleton for most properties and methods that a report would need, and subclass that skeleton for each individual report. 我想我会有一个抽象的报告类,为报告所需的大多数属性和方法提供框架,并为每个单独的报告子类化该框架。 Thus, one class per report, but all derived from a generic class. 因此,每个报告一个类,但所有类都派生自一个通用类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM