示例#1
0
        private void AttenreporCrystalForm1_Load(object sender, EventArgs e)
        {
            DataTable dt       = ds.Tables[0];
            DataTable joindate = hremp.GetemployeeJoinDate(_employee).Tables[0];
            string    str      = joindate.Rows[0][0].ToString();

            dt.TableName = "attentreport";
            AttenreporCrystal1 attenreport = new AttenreporCrystal1();

            attenreport.SetDataSource(ds);
            attenreport.SetParameterValue("DateTime", _date.ToString("yyyy-MM") + "---Attendance record monthly report");
            attenreport.SetParameterValue("empName", _employee.EmployeeName);
            attenreport.SetParameterValue("JoinDate", str);
            crystalReportViewer1.ReportSource = attenreport;
        }
示例#2
0
        private void AttenreporCrystalForm1_Load(object sender, EventArgs e)
        {
            DataTable dt       = ds;
            DataTable joindate = hremp.GetemployeeJoinDate(_employee).Tables[0];
            string    str      = joindate.Rows[0][0].ToString();

            dt.TableName = "attentreport";
            AttenreporCrystal1 attenreport = new AttenreporCrystal1();

            attenreport.SetDataSource(ds);
            attenreport.SetParameterValue("DateTime", _date.ToString("yyyy年MM月") + "---出勤記錄月報表");
            attenreport.SetParameterValue("empName", _employee.EmployeeName);
            attenreport.SetParameterValue("JoinDate", str);
            attenreport.SetParameterValue("DepartmentName", _employee.Department == null ? "" : _employee.Department.DepartmentName);
            attenreport.SetParameterValue("ShouldCheckIn", (_employee.BusinessHours == null ? "" : (_employee.BusinessHours.Fromtime.HasValue ? _employee.BusinessHours.Fromtime.Value.ToString("HH:mm") : "")));
            attenreport.SetParameterValue("ShouldCheckOut", (_employee.BusinessHours == null ? "" : (_employee.BusinessHours.ToTime.HasValue ? _employee.BusinessHours.ToTime.Value.ToString("HH:mm") : "")));
            crystalReportViewer1.ReportSource = attenreport;
        }