private void simpleButtonAccept_Click(object sender, EventArgs e) { Config.NewKeyValue("Operation", "Xem báo cáo"); Config.NewKeyValue("MenuName", this.Text); _bindingSource.EndEdit(); DataRowView drv = (_bindingSource.Current as DataRowView); DataReport __data = new DataReport((_data as DataReport).DrTable); __data.GetData(); __data.DsData = _data.DsData; __data.reConfig = new ReConfig(); __data.reConfig.Variables = (_data as DataReport).reConfig.Copy(); if (drv != null) { __data.DrCurrentMaster = drv.Row; } __data.CheckRules(DataAction.IUD); if (dxErrorProviderMain.HasErrors) { XtraMessageBox.Show("Chưa nhập đủ thông tin yêu cầu, vui lòng kiểm tra lại!"); return; } (__data as DataReport).SaveVariables(); (__data as DataReport).GenFilterString(); ReportPreview rptPre = new ReportPreview(__data); rptPre.MdiParent = this.MdiParent; rptPre.Show(); }
private void GetCongno_Click(object sender, EventArgs e) { try { if (MaKH == null) { return; } CDTData _data = DataFactory.DataFactory.Create(DataType.Report, "1453"); _data.GetData(); bsCongno.DataSource = _data.DsData.Tables[0]; bsCongno.AddNew(); bsCongno.EndEdit(); (bsCongno.Current as DataRowView)["NgayCT1"] = Tungay; (bsCongno.Current as DataRowView)["NgayCT2"] = Denngay; (bsCongno.Current as DataRowView)["TK"] = "131"; (bsCongno.Current as DataRowView)["MaKH"] = MaKH; DataReport __data = new DataReport((_data as DataReport).DrTable); __data.GetData(); __data.DsData = _data.DsData; __data.reConfig = new ReConfig(); __data.reConfig.Variables = (_data as DataReport).reConfig.Copy(); __data.DrCurrentMaster = (bsCongno.Current as DataRowView).Row; (__data as DataReport).SaveVariables(); (__data as DataReport).GenFilterString(); FormFactory.ReportPreview rptPre = new FormFactory.ReportPreview(__data); rptPre.Dock = DockStyle.Fill; pCongno.Controls.Clear();// rptPre.Visible = true; pCongno.Controls.Add(rptPre); } catch (Exception ex) { } }
public Dashboard(DataRow drReport) { _drReport = drReport; _data = new DataReport(drReport); if (_data.DsData == null) { _data.GetData(); } if (_data.DsData.Tables[0].Rows.Count == 0) { _data.DsData.Tables[0].Rows.Add(_data.DsData.Tables[0].NewRow()); } _data.GenFilterString(); }