public void BindData(ReportFilter filter) { try { ReportController rpCtr = new ReportController(); xrl_NgayBaoCao.Text = "Ngày báo cáo: " + string.Format("{0:dd/MM/yyyy}", filter.ReportedDate); var location = new ReportController().GetCityName(filter.SessionDepartment); xrtngayketxuat.Text = string.Format(xrtngayketxuat.Text, location, DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year); xrl_TenCongTy.Text = rpCtr.GetCompanyName(filter.SessionDepartment); // get organization var organization = cat_DepartmentServices.GetByDepartments(filter.SessionDepartment); if (organization != null) { //select form db var arrOrgCode = string.IsNullOrEmpty(filter.SelectedDepartment) ? new string[] { } : filter.SelectedDepartment.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < arrOrgCode.Length; i++) { arrOrgCode[i] = "'{0}'".FormatWith(arrOrgCode[i]); } var table = SQLHelper.ExecuteTable( SQLManagementAdapter.GetStore_ListEmployeeNotHaveHealthInsuranceRecord(string.Join(",", arrOrgCode))); DataSource = table; xrtmanhanvien.DataBindings.Add("Text", DataSource, "EmployeeCode"); xrthoten.DataBindings.Add("Text", DataSource, "FullName"); xrt_ngaysinh.DataBindings.Add("Text", DataSource, "BirthDate", "{0:dd/MM/yyyy}"); xrtgioitinh.DataBindings.Add("Text", DataSource, "Sex"); xrtdiachi.DataBindings.Add("Text", DataSource, "Address"); xrtdienthoai.DataBindings.Add("Text", DataSource, "Phone"); xrtngayvaocongty.DataBindings.Add("Text", DataSource, "ParticipationDate", "{0:dd/MM/yyyy}"); xrt_trinhdo.DataBindings.Add("Text", DataSource, "Education"); xrtchucvu.DataBindings.Add("Text", DataSource, "Position"); GroupHeader1.GroupFields.AddRange(new[] { new GroupField("DepartmentId", XRColumnSortOrder.Ascending) }); xrDepartmentName.DataBindings.Add("Text", DataSource, "DepartmentName"); } } catch (Exception ex) { Dialog.Alert("Có lỗi xảy ra: " + ex.Message); } }