如何在 VS Report Viewer 2008 中显示数据源内的子列表?

发布于 2024-08-16 04:49:48 字数 206 浏览 4 评论 0原文

我创建了一个静态通用列表(列表)并将其绑定到报表查看器的数据源。在报表查看器设计器中,我能够找到正确的数据源(列表),还能够将 ProductName、ProductNo 等属性从单个 Product 对象拖放到报表上。

然而,这个Product对象本身又包含另一个List(列表)。我的问题是如何从这个内部列表中获取对象并将它们显示到报告上?

任何帮助将不胜感激!

I have created a static Generic List (List) and bind it to a Report Viewer's data source. In the Report Viewer designer, I am able to find the correct data source which is List and also able to drag and drop properties like ProductName, ProductNo from a single Product object onto the report.

However, this Product object itself contains another List (List). My question is how I can get the objects from this inner List and display them onto the report?

Any help would be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2024-08-23 04:49:48

两种方法:

  1. 如果实际的第二个列表与第一个列表相关,即您在 OneSideTable.ID = ManySideTable.ID 上有某种联接。在这种情况下,您的报告组将由 OneSideTable.ID 组成,子记录将放置在详细信息部分中,以便您得到这样的效果:
Product: Ford
    -Focus
    -Mustang
    -Edge
    -Escape
    -Taurus    Product: GM
    -Accadia
    -Cobalt
    -HHR    ....
    ...

两个。另一种方法是您可以拥有第二个数据源并将另一个表/列表对象拖放到报表上。您可以告诉该对象采用第二个数据源 dsSecond。然后,您可以将第二个数据集中的字段拖放到报告的此表/列表中。

很简单!

2 ways:

  1. If the actual second list is related to the first list, that is you have some sort of join on a OneSideTable.ID = ManySideTable.ID. In that case your reports group would be by the OneSideTable.ID and the child records would be placed in the details section so that you get something to this effect:
Product: Ford
    -Focus
    -Mustang
    -Edge
    -Escape
    -Taurus    Product: GM
    -Accadia
    -Cobalt
    -HHR    ....
    ...

TWO. The other way to do it is you could have a second data source and drag and drop another table / list object onto the report. You would tell this object to take on the second datasource dsSecond. Then you can drag and drop your fields from this second dataset into this table / list of the report.

Very simple!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文