Crystal Reports - 输出记录的分组

时间:2009-09-28 12:35:50

标签: crystal-reports

我在Oracle中有一个存储过程,它将返回以下内容 下面给出5列,有序 (订购)日期,账户,资产,金额和类型。

在Crystal Reports中,我对过程返回的输出进行了分组 基于日期,帐户和资产列。

水晶报告的输出如下:

Date  Account  Asset  Amount  Type

Date1 Account1 Asset1 Amount1 Buy
Date1 Account1 Asset1 Amount1 Sell
Date1 Account1 Asset1 Amount2 Buy
Date1 Account1 Asset1 Amount2 Sell

Date2 Account2 Asset2 Amount3 Buy
Date2 Account2 Asset2 Amount4 Sell
Date2 Account2 Asset2 Amount5 Sell

Date3 Account3 Asset3 Amount6 Buy
Date3 Account3 Asset3 Amount6 Sell

Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount8 Sell

问题:水晶中是否有任何可能的方法来分离第一个 结果组如下所示基于列数量仅按分组日期, 帐户和资产,以便它不会影响另一组输出。 (或)

Date  Account  Asset  Amount  Type

Date1 Account1 Asset1 Amount1 Buy
Date1 Account1 Asset1 Amount1 Sell

Date1 Account1 Asset1 Amount2 Buy
Date1 Account1 Asset1 Amount2 Sell

Date2 Account2 Asset2 Amount3 Buy
Date2 Account2 Asset2 Amount4 Sell
Date2 Account2 Asset2 Amount5 Sell

Date3 Account3 Asset3 Amount6 Buy
Date3 Account3 Asset3 Amount6 Sell

Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount8 Sell

3 个答案:

答案 0 :(得分:2)

除非我遗漏了某些内容,否则您只需更改分组顺序:

日期,帐户,资产,金额,类型

为:

日期,帐户,资产,类型,金额

所以答案是按金额和类型添加一个组,因为你说它已经按日期,帐户和资产分组。

希望这有帮助。

答案 1 :(得分:0)

如果我是你,我会将分组条件设为具有正常逻辑和OR的公式,以检查您的特殊逻辑

答案 2 :(得分:0)

使用子组可能就是您要找的对象。我们的应用程序使用Crystal生成语句,我们有几个分组,因此我们可以在不同级别分离和总计:

  • 第1组是客户(用于运行批次)。
  • 第2组是有争议的状态(因此有争议的费用或不良付款会单独列出)。
  • 第3组是交易(收费和付款)。
  • 第4组是个人购买或退款的项目。

我们使用分组摘要列出每个销售下的小计和每个客户的总余额。

如果您将一个组用于日期,帐户和资产,请尝试添加新组(菜单插入 - >组)并选择金额作为分组依据。 Crystal保持细节部分完好无损。然后,您可以在每个Amount组的末尾添加额外的空间,或者根据需要插入group-sub-totals(右键单击字段并从弹出式选择Insert - > Summary)。 Crystal允许至少五个分组级别。