【问题标题】:Repeat details section in Crystal ReportCrystal Report 中的重复详细信息部分
【发布时间】:2014-10-28 17:16:58
【问题描述】:

我是 Crystal Reports 的新手。我正在尝试使用我的数据库的一些表创建一个报告。所以,我用这些表创建了一个 DataSet 并加入了表。我有:

A (primary table; key field id_a)
B (join to A by id_a; one to one relationship)
C (join to A by id_a; one to many relationship)
D (join to C by id_c; one to many relationship)

然后我尝试在设计视图中创建这个表单:

Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value of B.column_z

Name column D.column_j      Name column D.column_i
XYJ                          HJU
IOP                          IOP

表A中有一条记录(我通过参数过滤),表D中有多个行项目值对应A中的这个值。我在输出中查看:

Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value of B.column_z 

Name column D.column_j      Name column D.column_i
XYJ                          HJU


Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value of B.column_z 

Name column D.column_j      Name column D.column_i
IOP                          IOP

我不知道为什么,但是每次显示 D 列值时都会一遍又一遍地重复第一部分,而且我不知道如何将 D 的值放在一起。

我试图通过创建表 C 和 D 的视图来修复它,但它是相同的。我在不同的详细信息部分将这两个部分分开,但没有任何变化。

编辑:

正如我所说,我尝试了另一种方式并创建了一个视图(表 C 和 D)。然后,现在我有:

A (primary table; key field id_a)
B (join to A by id_a; one to one relationship)
VIEW D (FK id_a; one to many relationship)

我在设计视图中:

详细说明:

Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value of B.column_z

细节b:

Name column D.column_j      Name column D.column_i
XYJ                          HJU
IOP                          IOP

但我仍然遇到同样的问题。

我该如何解决这个问题?

【问题讨论】:

  • 您将第一部分和第二部分放在报告中的什么位置?
  • 为什么不将 C 表链接更改为 B 而不是 A 以避免多个链接到同一个表字段?
  • Siva:现在,我将这两个部分放在不同的细节部分。 cojimarmiami:我删除了 CR 中的连接,因为现在我正在使用表 A、B(它们之间的连接)和视图。
  • @veri 你能用你的新变化更新你的帖子吗?

标签: crystal-reports crystal-reports-2008


【解决方案1】:

如果您输入 2 个详细信息,那么输出将是您得到的...

要获得所需的输出...

将这些放在页眉中

Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value of B.column_z

详细说明:

Name column D.column_j      Name column D.column_i
XYJ                          HJU
IOP                          IOP

如果页面标题中有重复数据,则出路是:

  1. 在主报告中创建 2 个子报告...details a 中的一个报告和details b 中的一个。

details a 中的字段下方

 Name column X: value of A.column_x
 Name column Y: value of A.column_y
 Name column Z: value of B.column_z

details b 中的字段下方

Name column D.column_j      Name column D.column_i
XYJ                          HJU
IOP                          IOP

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-14
    • 1970-01-01
    • 1970-01-01
    • 2016-07-22
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 2019-06-27
    相关资源
    最近更新 更多