.rdlc 报告绑定到三层应用程序中的对象数据源
我有以下情况,我在 asp.net 应用程序(不是网站,这意味着不存在 App_Code 文件夹)中有一个报告层(独立),并且我只想创建对象数据源以在单独的层中获取对象(让我们说从数据访问层),然后使用该对象数据源创建报告,我花了一整天的时间来解决这个问题,网上有大量的解决方法和文章,但没有提到我真正想要的做,任何答案都适用...
只是为了让事情更清楚,假设如下:
我有一个包含以下层的解决方案,
- UI
- 报告(没有员工对象)只是一个参考
- 业务逻辑
- 数据访问层(员工-- >GetEmployees(),
我所需要的就是上面提到的,我想从Reporting层创建对象数据源,从DAL中获取Employee对象,然后使用它的GetEmployees方法将其添加到 报告,我认为现在更清楚了,因为报告层也没有 App_Code 文件夹。
i have the following situation, i have a Reporting layer(stand alone) in asp.net application(NOT website, this means NO App_Code folder exists), and i want just to create Object Data Source to take an Object in a separate layer(lets say from Data Access Layer), and then to use that Object Data Source to create a report, i have spent my whole day working around that, tons of work around's and articles on the web, but does not mention what i really want to do, any answer is appriciated...
just to make things more clear here, assume the following:
i have a solution with the follwoing layers,
- UI
- Reporting(has NO Employees object) just a reference
- Business Logic
- Data Access Layer(Employees-->GetEmployees(),
all i need is as mentioned above, i want to create Object Data Source from Reporting layer, to take Employee object from DAL, and then use it's GetEmployees method to be added to
report, i think its more clear now, since also Reporting layer has NO App_Code folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样做的方法是创建一个具有 List 类型属性的类。我在这个类中有一个名为 LoadReport(params......) 的方法,我将在其中调用 GetEmployess 来填充我的属性。
然后,我将在报表设计器中添加一个新的数据集,选择绑定到对象,然后选择我创建的类。完成后,数据集将允许您展开“列表”属性,您可以将不同的字段拖到设计器上。
我已经在 VS2008 中完成了此操作,目前正在尝试在 VS2010 中
The way Ive been doing it is by creating a class that has a property of type List. I dhave a method called LoadReport(params......) in this class where I would call GetEmployess to populate my property.
I would then add a new Dataset in the report designer, selecting to bind to Object, and selecting the class i created. Once finished the dataset will allow you to expand the List property where you can drag different fields onto the designer.
Ive done this in VS2008, currently attempting in VS2010