如何在同一个Form Grid 中显示Header 和Line 记录?

How to show in the same Form Grid, Header and Line records?

我有问题。我需要在同一个 Form 的 Grid 中同时包含 Header 记录和 Line 记录。

我的 Header 是 CustInvoiceJour 我的线路是 CustInvoiceTrans Table 关系是:CustInvoiceTrans.ParentRecId == CustInvoiceJour.RecId.

我想在同一网格中显示一些 CustInvoiceJour 字段和另一个 CustInvoiceTrans 字段。

我在网上找到了这个 tutorial : 但我忘记了什么或者我需要更多信息。 因为我只看到一个 CustInvoiceJour 和它的行,所有其他 Header 并且它没有显示。

你能帮帮我吗?您还有其他解释示例或建议吗?

您可以创建一个新查询,使用上述关系在数据集中包含这两个表。

创建查询后,您可以将该查询作为数据源添加到表单网格中。

使用名为 CustInvoiceTransExpanded 的查询,其中包含您提到的两个表以及其他一些可能有用的表。

添加 CustInvoiceJourCustInvoiceTrans 作为数据源。在 CustInvoiceTrans 数据源上,将属性 JoinSource 更改为 CustInvoiceJour,将 LinkType 更改为 InnerJoin

在网格控件上将 DataSource 属性 设置为 CustInvoiceJour

将字段从数据源拖到字段中。