开发者

How to get Employee's Attendance History on Crystal Report

I hav开发者_JS百科e table with the following fileds:

AttendanceID             bigint
EmployeeID           bigint
AttendanceDate           datetime
FiscalMonthID            int
TimeIn                     datetime
TimeOut          datetime
TimeIn1          datetime
TimeOut1             datetime
HoursWorked          decimal(18, 2)
LateHours            decimal(18, 2)
Status                     nvarchar(10) ('Present', 'Absent', 'Holiday', 'Sick Leave')
Remarks          nvarchar(250)

Now i want to generate a crystal report for each employee's attendance history...that will show total number of 'Presents', 'Absent', 'Sick Leaves' for a specicif dates or month.

i.e. How i can get total Presnets and Absents or Sick Leaves of one employee during the month.


You could use a stored procedure to feed data to the report. It would take the EmployeeID and month (or a date range) as the input and probably return AttendanceDate and Status; you might be more interested in AttendanceDate, HoursWorked and Status, depending on what the actual data looks like.

You could then group the return values for the dates by either using a GROUP BY statement for the return data or by grouping the data itself in the Crystal Report.


Insert a group on Employee ID, then one on AttendanceDate (be sure to choose month as the period), then one on Status. Select the AttendanceId field, then Insert Summary and choose Count.

If you want to filter the report by date, add a date parameter (set the Range option to true), then create a record-selection formula that resembles:

//change values to reflect your situation
{table.AttendanceDate} IN {?data-range parameter}

Consider reading a book on the topic or attending a class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜