private void btnView_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { if (gvDispatchDC.FocusedRowHandle >= 0) { DataSet ds = ObjStockRep.GetDispatchDC(gvDispatchDC.GetFocusedRowCellValue("DISPATCHDCID")); if (ds != null && ds.Tables.Count > 1) { rptDispatchDC rpt = new rptDispatchDC(ds.Tables[0], ds.Tables[1]); rpt.ShowPrintMarginsWarning = false; rpt.ShowRibbonPreview(); } } } catch (Exception ex) { ErrorMgmt.ShowError(ex); ErrorMgmt.Errorlog.Error(ex); } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (!dxValidationProvider1.Validate()) { return; } DataSet ds = new StockRepository().SaveDispatchDC(cmbBranch.EditValue, cmbCategory.EditValue, Utility.UserID); if (ds == null || ds.Tables.Count == 0) { throw new Exception("No Dispatch Exists"); } rptDispatchDC rpt = new rptDispatchDC(ds.Tables[0], ds.Tables[1]); rpt.ShowPrintMarginsWarning = false; rpt.ShowRibbonPreview(); } catch (Exception ex) { ErrorMgmt.ShowError(ex); ErrorMgmt.Errorlog.Error(ex); } }