水晶报表 - 计数公式 [英] Crystal Reports - Count Formula

查看:35
本文介绍了水晶报表 - 计数公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Crystal 中开发一个报表,我需要对具有多种不同状态的特定字段进行计数.例如,我的报告中有一个StatusType"字段,其中包含 In Process"、Rejected"、On Hold"或Submitted" 值.我希望能够对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""Submitted".我想显示的所有计数都不需要在报告正文或详细信息中,而是在报告/页眉中.

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.

创建一个新的 Running Total 并输入以下选项:

Create a new Running Total and enter the following options:

  • 要总结的字段:{StatusType}
  • 摘要类型:计数
  • 评估:勾选Use a Formula并按下公式按钮.
  • 在公式框中输入 {StatusType} = "Submitted"
  • 重置:勾选从不
  • 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,但我认为应该这样做.然后你可以重复 Rejected 状态类型的过程.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆