水晶报表-计数公式 [英] Crystal Reports - Count Formula
问题描述
我正在使用Crystal开发报表,我需要对具有几种不同状态的特定字段进行计数。例如,我的报表中有一个 StatusType字段,其中包含处理中,已拒绝,保留或已提交
的值。我希望能够对 StatusType字段中的一个公式中的 Rejected和 Submitted
有多少个值进行计数。该报告按 StatusType
分组。
I am developing a report in Crystal and I need to do a count on a particular field that has several different statuses. For example, I have a "StatusType" field in my report that contains values that are "In Process", "Rejected", "On Hold", or "Submitted"
. I want to be able to do a count on the "StatusType" field as to how many values are "Rejected" and "Submitted"
in one formula. The report is grouped by "StatusType"
.
我是在Crystal Reports中编写公式的新手,因此希望获得一些指导,以获取可以计算该字段中这两个值的公式。请让我知道需要什么其他信息,或者对我的问题有帮助。
I'm new to writing formulas in Crystal Reports so would appreciate some guidance with getting a formula that will count those two values in the field. Please let me know what additional information is needed or would be helpful to assist with my question.
我不需要在每个组的开始/结尾显示每个状态类型的总数,但是想要在页面或报告标题中显示。我不确定哪一个最好。我想在报告中的某个位置统计每个状态,然后能够合并几个状态计数,例如 Rejected
和已提交
。我要显示的所有计数都不需要位于报表正文或详细信息之内,而不必位于报表/页面标题中。
I do not need to display the total count for each Status Type at the start/end of each group, but would like to in the page or report header. I'm not sure which would be best. I would like to have counts of each status in one spot on the report and then be able to combine a couple of the status counts, such as the "Rejected"
and "Submitted"
. None of the counts I want to display need to be within the body of the report or within the details but rather in the report/page header.
推荐答案
我认为最好的选择是使用RunningTotal而不是公式。
I think the best option here would be to use a RunningTotal rather than a formula.
创建新的运行总计并输入以下选项:
Create a new Running Total and enter the following options:
- 要汇总的字段:
{StatusType}
- 摘要类型:
计数
- 评估:选中
使用公式
并按公式按钮。 - 在公式框中输入
{StatusType} =已提交
- 重置:选中
从不
- Fields to summarize:
{StatusType}
- Type of Summary:
Count
- Evaluate: Check
Use a Formula
and press the formula button. - In the formula box enter
{StatusType} = "Submitted"
- Reset: Check
Never
我目前尚未在此计算机上安装Crystal,但我认为应该这样做。然后,您只需为已拒绝
状态类型重复该过程即可。
I don't have Crystal installed on this machine at the moment but I think that should do it. Then you can just repeat the process for the Rejected
status type.
这篇关于水晶报表-计数公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!