Monthly Attendnace Report of All employees

This code snippets is for displaying monthly attendance report of a ll employees in a organization.I googled a lot to get this.At last I find out a soultion for thi problem.This report wil display attendance of employe in the follwoing format


Slno Employee 1 2 3 4 5 6 7 8 9 '............................ 31
1 Arun P P P L P P P L/2............................... P
2 Akhila CL P P P L P P P................................. L
3 Aruna P A P P P L P P


1,2,3,4 -Date from 1-31
P -Present
L-Leave
L/2-alf Day Leave
A- Absent(Leave application not submitted)

Procedure

1. First we want to group the employee (optional) here am grouping employees based on Projects.
2.Next we want to create 31 formulas for each date
For Eg: For Day 1


IF Day ({ATTENDANCE_MASTER.WEFDate})=1 THEN
{ATTENDANCE_MASTER.Status}

For Day 1

IF Day ({ATTENDANCE_MASTER.WEFDate})=2 THEN
{ATTENDANCE_MASTER.Status}


ATTENDANCE_MASTER -Table
WEFDate - Field -(Date)
Status -Field(P,CL,A,L) etc....


3. Craete 2 parameters StartDate and EndDate
4.Place the formula under each Date (U can take MAx of each forumla and palce under dates .For eg under date1,Maxof Formula1)
5.Wrte the code in VB.net Form ---- Submit Button click


db.MyConnection()
Dim Filter As String = ""
If Me.dropproject.SelectedIndex >= 0 And Me.TxtDateFrom.Text <> "" And Me.txtDateTo.Text <> "" Then
Session("ProjectId") = Me.dropproject.SelectedValue
Dim dtFrom(3) As String
Dim dtTo(3) As String
If (Me.TxtDateFrom.Text.Trim() <> "") Then
dtFrom = Me.TxtDateFrom.Text.Split("/")
Else
dtFrom(0) = "0"
dtFrom(1) = "0"
dtFrom(2) = "0"
End If
If (Me.txtDateTo.Text.Trim() <> "") Then
dtTo = Me.txtDateTo.Text.Split("/")
Else
dtTo(0) = "0"
dtTo(1) = "0"
dtTo(2) = "0"
End If
Dim frmDate As Date
Dim toDate As Date
frmDate = "" & dtFrom(1) & " / " & dtFrom(0) & " / " & dtFrom(2) & ""
toDate = "" & dtTo(1) & " / " & dtTo(0) & " / " & dtTo(2) & ""
If dropproject.SelectedIndex > 0 Then
If dropproject.SelectedValue = "All" Then
filter = "{ATTENDANCE_MASTER.WEFDate} >= #" + frmDate + "#"
Filter = Filter + " and {ATTENDANCE_MASTER.WEFDate} <= #" + toDate + "#"
Filter = Filter + " and {EMPLOYEE_MASTER.EmpStatus} <>2"
Else
filter = "{ATTENDANCE_MASTER.WEFDate} >= #" + frmDate + "#"
filter = filter + " and {ATTENDANCE_MASTER.WEFDate} <= #" + toDate + "#"
Filter = Filter + " and {PROJECT_MASTER.ProjectId}=" & Session("ProjectId") & ""
Filter = Filter + " and {EMPLOYEE_MASTER.EmpStatus} <>2"

End If
End If
OverallAttendance.RefreshReport()
OverallAttendance.Visible = True
Me.OverallAttendance.SelectionFormula = filter
'Passing the Parameter Code
Dim crpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim paramfields As New CrystalDecisions.Shared.ParameterFields()
Dim paramfield As New CrystalDecisions.Shared.ParameterField()
Dim paramfield2 As New CrystalDecisions.Shared.ParameterField()
Dim paramfield3 As New CrystalDecisions.Shared.ParameterField()
Dim discrtvalue As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim discrtvalue2 As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim discrtvalue3 As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim newlogoninfo As New CrystalDecisions.Shared.TableLogOnInfo()
discrtvalue.Value = frmDate
paramfield.ParameterFieldName = "StartDate"
paramfield.CurrentValues.Add(discrtvalue)
paramfields.Add(paramfield)
discrtvalue2.Value = toDate
paramfield2.ParameterFieldName = "EndDate"
paramfield2.CurrentValues.Add(discrtvalue2)
paramfields.Add(paramfield2)
OverallAttendance.ParameterFieldInfo = paramfields
End If





For details am attaching Crystal report


Attachments

Comments

Guest Author: lingaiah04 Jun 2012

Can u send the sample for the attendance report

Author: Riaz Vhouhan02 Oct 2012 Member Level: Bronze   Points : 0

Hygeena,

I can't download attachment,
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

Please Help

Author: sadia03 Nov 2012 Member Level: Bronze   Points : 0

can you e-mail me project i need for my university project i can get help from this project attendance system

Author: Hafiz Abdul Rahman Khalid04 Jan 2015 Member Level: Bronze   Points : 0

Can u send me the monthly attendance report for all employee...?


Email: se.khalid@hotmail.com



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: