Count fuction

Stimulsoft Reports.NET discussion
Post Reply
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

Count fuction

Post by Kennedy »

I have one field DeductionAbsent, value is boolean type.
I want to generate one monthy attendance report per day.
My requirement is

let the report i like this

Date Absent
1/1/2011 y
1/2/2011 N
1/3/2011 Y

in the group footer , iwnt to get the total number of absent days ,means 2.


i tiried to create a formula like this,
IFF(DeductionAbsent=='Y' ? Count(DeductionAbsent))
But it is not working.
It is urgent for me,Please help me to achieve this.






joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Count fuction

Post by joro »

Hello!

If your datatype is boolean and we assume that true == 1 and false == 0 then you could just sum up the different boolean values to get the total number of absent days.
Have you tried that?
joro
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

Count fuction

Post by Kennedy »


I tried using the following formula
{(AttendLog.DeductionAbsent == 1 ? Count(AttendLog.DeductionAbsent)};

But i am getting the following error
"Reports.Report doesnot contain a defintion of AttendLog_DeductionAbsent."

Can u please tell me what does it mean.Being newbie to stimulsoft ,it is very difficult to do formulas .
joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Count fuction

Post by joro »

Hello!

Drag a Text-Field to your GroupFooter.

1. Click the text field with the right mousebutton and choose "Design".
2. Click Summary
3. Choose Summary Function -> Sum
4. Data Band -> DataBand1 (or whatever the name of your databand is)
5. Data Column: Choose "DeductionAbsent" from the DropDown
6. Click OK and your sum will appear.

Keep in mind, every group footer needs a corresponding group header! Otherwise the sum-function won't work

HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Count fuction

Post by HighAley »

Hello.

Or you should just use next expression

Code: Select all

{Sum(DataBand1,AttendLog.DeductionAbsent)}
Thank you.
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

Count fuction

Post by Kennedy »

That is fine. But my requirement is to get count of days only with AttendLog.DeductionAbsent is true.
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

Count fuction

Post by Kennedy »

Thank you joro and Aleksey.It is working perfectly fine...
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Count fuction

Post by Andrew »

Hello,

Great! Have a good week!

Thank you.
Post Reply