【问题标题】:How to summarize all records in Crystal Reports 8.01Crystal Reports 8.01中如何汇总所有记录
【发布时间】:2012-01-30 07:45:54
【问题描述】:

我对如何汇总 Crystal Reports 8.01 中的所有记录有疑问。我正在使用 VB6。

example:
date             tools               in              out              
1/19/2012       stone               100              0
1/20/2012       stone                50              0
1/21/2012       stone                30              0
1/25/2012       stone                 0              40
1/26/2012       stone                 0              20

total in  until now : 180
total out until now :  60

我在 VB 6 中使用以下代码:

With CrystalReport1
 .SelectionFormula = "{stock.dates} >= #" & Format(DTPicker5.Value, "yyyy-mm-dd") & "#        and {stock.dates}<= #" & Format(DTPicker6.Value, "yyyy-mm-dd") & "#"

End With

在 Crystal Reports 中,使用公式编辑器:

Sum ({stock.in}) ==> for total in
Sum ({stock.out}) ==> for total out

当我从 2012 年 1 月 19 日到 2012 年 1 月 26 日运行日期时,结果是:

total in until  now : 180
total out until now :  60 its true

但是当我从 2012 年 1 月 20 日到 2012 年 1 月 26 日运行日期时,结果是:

 total in  until now : 80 (the value is change)
 total out until now : 60

如何使总和的值在选择日期时从开始到最后一个日期不变?

【问题讨论】:

  • 我努力了,但这个问题仍然没有多大意义。
  • 可能他需要所有记录的总和,但只显示最后的一些记录。
  • 是的,我需要所有记录的总和,但只显示一个

标签: sql-server vb6 crystal-reports


【解决方案1】:

您至少有两个选择:

  1. 创建一些存储过程,能够计算任何日期的总余额并在报告中使用该过程
  2. 不根据日期过滤记录(即不设置选择公式),但禁止显示旧记录;您需要使用一些参数将此日期转发给水晶对象(缓慢,但有时只有这种可能性)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-25
    • 2015-07-26
    • 1970-01-01
    相关资源
    最近更新 更多