on 02-08-2013 11:32 PM
I am using SAP Crystal for VS 2010 to generate report. I have a Boolean field named Status in the report that indicate whether a person was present or not .
I want to know whether it is possible to get the number of times a person was present/absent and how it can be implemented. In other words, I want to be able to indicate the number of Yes/No or 1/0 for a person
Any assistance would greatly appreciated.
Thank you
Hi Paul,
Assuming the report is grouped on 'Person', here's what you can do:
whileprintingrecords;
numbervar present;
numbervar absent;
booleanvar Status;
if Status = 1 then
present := present + 1
else if Status = 0 then
absent := absent + 1;
Place this formula field on the report beside the Status variable and suppress it.
Next, create this formula to count the no. of times the person was present/absent. Place this formula on the Group Footer:
whileprintingrecords;
numbervar present;
numbervar absent;
"This person was Present :"&present&" time/s"&chr(13)&
" and Absent :"&absent&" time/s"
Lastly, create a formula to reset the variables and place it on the Group Header. You may keep this field suppressed.
whileprintingrecords;
numbervar present := 0;
numbervar absent := 0;
Let me know how this goes!
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also do this without the variables.... You would create two formulas that look like this:
{@IsPresent}
if status = 1 then 1 else 0
{@IsAbsent}
if status = 0 then 1 else 0
You then sum these formulas to get the count of present and absent.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.