简体   繁体   English

在Crystal Reports C#中计数

[英]Count in Crystal Reports C#

I have a field that is either YES or NO and I want to display at the end of my report a count of how many "YES"s there were in that field. 我有一个是“是”或“否”的字段,我想在报告的末尾显示该字段中有多少个“是”的计数。 I made a running total field and set the formula equal to that field ("YES"), but that shows up for every record. 我创建了一个总计字段,并将公式设置为等于该字段(“是”),但是每条记录都会显示该公式。 I just want one number at the end. 我只想要一个数字结尾。 Is there a way to do this? 有没有办法做到这一点?

Make a static field (int counter). 创建一个静态字段(int计数器)。 Every time you select a "Yes" just increment counter by 1. You can access the counter to check the number of "YES". 每次选择“是”,只需将计数器加1。您可以访问计数器以检查“是”的数量。

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

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