private void pivotGridControl_CellDoubleClick(object sender, DevExpress.XtraPivotGrid.PivotCellEventArgs e) { var employeeStatisticDetailForm = new EmployeeStatisticsDetail(); employeeStatisticDetailForm.Display(e.CreateDrillDownDataSource()); }
private void CurrentGridIncomeAnalysis_CustomSummary(object sender, DevExpress.XtraPivotGrid.PivotGridCustomSummaryEventArgs e) { if (e.DataField != colTest && e.DataField != v2TargetAmount && e.DataField != DayAvg) return; decimal TotalAmount = 0; decimal txtTargetAmount = 0; int daysMonthEnd = 0; // Get the record set corresponding to the current cell. PivotDrillDownDataSource ds = e.CreateDrillDownDataSource(); // Iterate through the records and count the orders. for(int i = 0; i < ds.RowCount; i++) { PivotDrillDownDataRow row = ds[i]; // Get the order's total sum. if (row["TargetAmount"] == null) txtTargetAmount = 0; else txtTargetAmount = (decimal)row["TargetAmount"]; daysMonthEnd = (int)row["DaysMonthEnd"]; TotalAmount += (decimal)row["mNettAmount"]; } if(ds.RowCount > 0) { if(e.DataField == v2TargetAmount) { e.CustomValue = txtTargetAmount - TotalAmount; } else if (e.DataField == DayAvg) { if (daysMonthEnd == 0) e.CustomValue = 0; else e.CustomValue = (txtTargetAmount - TotalAmount)/daysMonthEnd; } else { if (txtTargetAmount == 0) e.CustomValue = 1; else e.CustomValue = TotalAmount/txtTargetAmount; } } }
private void PrevGridIncomeAnalysis_CustomSummary(object sender, DevExpress.XtraPivotGrid.PivotGridCustomSummaryEventArgs e) { if (e.DataField != vTargetAmt && e.DataField != TargetAmt) return; decimal TotalAmount = 0; decimal txtTargetAmount = 0; // Get the record set corresponding to the current cell. PivotDrillDownDataSource ds = e.CreateDrillDownDataSource(); // Iterate through the records and count the orders. for(int i = 0; i < ds.RowCount; i++) { PivotDrillDownDataRow row = ds[i]; if (row["TargetAmount"] == null) txtTargetAmount = 0; else txtTargetAmount = (decimal)row["TargetAmount"]; TotalAmount += (decimal)row["mNettAmount"]; } if(e.DataField == TargetAmt) { e.CustomValue = txtTargetAmount - TotalAmount; } else { e.CustomValue = txtTargetAmount; } }
void pivotGridControl1_CellDoubleClick(object sender, DevExpress.XtraPivotGrid.PivotCellEventArgs e) { try { f441_thuc_linh_de frm = new f441_thuc_linh_de(); frm.fillDataSource(e.CreateDrillDownDataSource()); frm.ShowDialog(); } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }
private void gvPromotionAnalysis_CellDoubleClick(object sender, DevExpress.XtraPivotGrid.PivotCellEventArgs e) { Form form = new Form(); form.Text = "Records"; // Place a DataGrid control on the form. DataGrid grid = new DataGrid(); grid.Parent = form; grid.Dock = DockStyle.Fill; // Get the recrd set associated with the current cell and bind it to the grid. grid.DataSource = e.CreateDrillDownDataSource(); form.Bounds = new Rectangle(100, 100, 500, 400); // Display the form. form.ShowDialog(); form.Dispose(); }
private void m_pv_CellDoubleClick(object sender, DevExpress.XtraPivotGrid.PivotCellEventArgs e) { try { if (check_bang_luong_da_chot(m_txt_thang.ToString(), m_txt_nam.ToString())) { XtraMessageBox.Show("Tháng đã chốt bảng lương. Vui lòng không cập nhật!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } f394_cham_cong_thang_detail v_f = new f394_cham_cong_thang_detail(); PivotDrillDownDataSource v_ds = e.CreateDrillDownDataSource(); PivotDrillDownDataRow v_dr = v_ds[0]; var v_id_loai_ngay_cong = CIPConvert.ToDecimal(v_dr["ID_LOAI_NGAY_CONG"].ToString()); //var v_id_nhan_vien = CIPConvert.ToDecimal(v_dr["ID_NHAN_VIEN"].ToString()); v_f.display_for_update(ref v_id_loai_ngay_cong); US_GD_CHAM_CONG v_us = new US_GD_CHAM_CONG(CIPConvert.ToDecimal(v_dr["ID"].ToString())); if (v_us.dcID_LOAI_NGAY_CONG != v_id_loai_ngay_cong) { v_us.dcID_LOAI_NGAY_CONG = v_id_loai_ngay_cong; v_us.Update(); XtraMessageBox.Show("Sửa dữ liệu chấm công thành công", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information); load_data_to_m_pv(); } } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); } }