简体   繁体   English

水晶报表和运行总计

[英]Crystal Reports, and running totals

I am designing a report in which a Running Balance column adds itself to Debit and subtracts the answer from Credit column on every row. 我正在设计一个报告,其中“运行余额”列将其自身添加到“借方”,并从每一行的“贷方”列中减去答案。 Here in this example I have started calculating from 1st of January. 在此示例中,我从1月1日开始计算。 In this case, my Running Balance column will have zero. 在这种情况下,我的“运行余额”列将为零。

Now my client wants to have a look at records from 17 January to the end. 现在,我的客户希望查看1月17日至年底的记录。 In that case, my cumulative balance will NOT be zero at first but instead it will calculate cumulative balance for all the dates before 17 January, and present it as the starting balance for 17th of January. 在这种情况下,我的累积余额起初不会为零,而是会计算1月17日之前所有日期的累积余额,并将其作为1月17日的初始余额显示。 I am stuck at this point. 我被困在这一点上。 How to add all the record before 17th of January and show their Total in a single row. 如何在1月17日之前添加所有记录,并在一行中显示其总计。

There are lots of different ways to achieve this, but here's one idea you might like to try. 有很多不同的方法可以实现这一目标,但是您可能想尝试以下一种方法。

  • Set the report selection criteria to include all records from 01/01. 设置报告选择标准以包括从01/01开始的所有记录。
  • Create 2 report detail sections. 创建2个报告详细信息部分。
  • In the first detail section just place the running total and maybe a label: "Starting Balance". 在第一个详细信息部分中,将运行总计以及可能的标签放置:“起始余额”。
  • In the second detail section place your normal fields. 在第二个详细信息部分中,放置普通字段。
  • In the section expert use a formula to suppress the first detail section: {table.date} <> {?date parameter} 在该部分中,专家使用公式{table.date} <> {?date parameter}第一个详细信息部分: {table.date} <> {?date parameter}
  • In the section expert use a formula to suppress the second detail section: {table.date} < {?date parameter} 在该部分中,专家使用公式{table.date} < {?date parameter}第二个详细信息部分: {table.date} < {?date parameter}

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM