如何使用列表作为报告的数据源?
在我的 Visual Studio 项目中,我有一个名为 Person 的类和另一个名为 People 的类。 People 包含一个公共 List 属性。 Person 类保存从不同数据库和文件中提取的有关人员的数据。基本上,后端是一个可怕的混乱,我继承了它,并且 Person 类将它们整合在一起。
现在,我对报告编写还很陌生,但已经成功设计了一些本地报告来直接显示来自 SQL 服务器的数据,但我在这里想要做的是显示 List 属性中包含的数据,但我不知道如何做吧!有人能够通过列出我必须执行的步骤来指出正确的方向吗?
预先感谢,
马特
In my Visual Studio project I have a class called Person and another class called People. People contains a public List property. The Person class holds data about the person pulled in from different databases and files. Basically the back end is a horrific mess which I have inherited and the Person class pulls it all together.
Now, I'm fairly new to report writing but have successfully designed a few local reports to display data directly from an SQL server but what I want to do here is display the data contained within my List property but I don't know how to do it! Would someone be able to point me in the right direction by listing the steps I would have to go through to get this to work?
Thanks in advance,
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有更简单的方法可以完成您想要的操作,但如果您想使用 List,则可能可以使用 BindingList 而不是 List。请参阅此处。另请检查 Google 中的 LINQ to Objects。
There are more easy ways to do what you want but if you want to play with List, than probably you can use BindingList instead of List. See here. Also please check LINQ to Objects in Google.