Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
Posted

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900