如何使用Winforms C#计算Crystal Report中的值。 [英] How to count value in Crystal Report with Winforms C#.

查看:60
本文介绍了如何使用Winforms C#计算Crystal Report中的值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am using Crystal Report in Winforms with C#.

My Output Like :

StudentID   Name   1   2   3   4   5

    1        a     P   P   P   A   P
    2        b     A   P   A   P   A
    3        c     P   A   A   P   P
    4        d     A   A   A   P   A

But I want to Output Like :

StudentID   Name   1   2   3   4   5   Present   Absent

    1        a     P   P   P   A   P      4         1
    2        b     A   P   A   P   A      2         3
    3        c     P   A   A   P   P      3         2
    4        d     A   A   A   P   A      1         4
    
    -       Pre.   2   2   1   3   2
    -       Abs.   2   2   3   1   2

So how i can count this.

Thanx in Advance...

推荐答案

为这5列创建公式字段。(例如fDay1 - 返回1表示P,-1表示A)



并为Present&Absent创建公式。基于您问题的第一行数据。



Ex。 fPresent =求和公式字段的值(fDay1 + fDay2 + fDay3 + fDay4 + fDay5)= 4

Ex。 fAbsent =总计(5) - fPresent(4)= 1
Create formula fields for those 5 columns.(Ex. fDay1 - Return 1 for P, -1 for A)

And create formula for Present & Absent. Based on first row data from your question.

Ex. fPresent = Sum the values of formula fields(fDay1 + fDay2 + fDay3 + fDay4 + fDay5) = 4
Ex. fAbsent = Total(5) - fPresent(4) = 1


这篇关于如何使用Winforms C#计算Crystal Report中的值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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