private void butFillReport_Click(object sender, EventArgs e) { try { int Guarantor = Int32.Parse(this.textBox1.Text); if (Guarantor < 1) { throw new Exception("Invalid Guarantor Number"); } this._Report_GA = new OpenDental.Reporting.Allocators.MyAllocator1.SupportingCode.Report1_GuarantorAllocation(); _Report_GA.FILL(Guarantor); this.lblTitle.Text = _Report_GA.TITLE; this.dgridView_ReportData.DataSource = _Report_GA.MAIN_REPORT; this.dgvSummary.DataSource = _Report_GA.SUMMARY; #region Stylize the DataGridViews //DataGridViewCellStyle defaultCellStyle1 = new DataGridViewCellStyle(); //defaultCellStyle1.Padding = new Padding(0,0,0,0); //defaultCellStyle1.Font = new Font("Arial", 8F); //DataGridViewCellStyle defaultCellStyle2 = new DataGridViewCellStyle(defaultCellStyle1); //defaultCellStyle2.BackColor = Color.LightCyan; //this.dgridView_ReportData.DefaultCellStyle = defaultCellStyle1; //this.dgridView_ReportData.AlternatingRowsDefaultCellStyle = defaultCellStyle2; //this.dgridView_ReportData.CellBorderStyle = DataGridViewCellBorderStyle.None; //this.dgridView_ReportData.RowHeadersVisible = false; // Above Code moved to Static Method MyAllocator1.ReportUI.ReportStyles.Set_DefaultDataGridViewStyle(dgridView_ReportData); #endregion #region Update The Form Caption int index = this.lblTitle.Text.IndexOf('\n'); if (index > 0) { this.Text = this.lblTitle.Text.Substring(0, index); } else if (this.lblTitle.Text.Length > 0) { this.Text = this.lblTitle.Text; } else { this.Text = "Allocation Report for Guarantor: " + Guarantor; } #endregion } catch (Exception exc) { PU.MB = exc.Message; } }
private void butFillReport_Click(object sender, EventArgs e) { try { int Guarantor = Int32.Parse(this.textBox1.Text); if (Guarantor < 1) throw new Exception("Invalid Guarantor Number"); this._Report_GA = new OpenDental.Reporting.Allocators.MyAllocator1.SupportingCode.Report1_GuarantorAllocation(); _Report_GA.FILL(Guarantor); this.lblTitle.Text = _Report_GA.TITLE; this.dgridView_ReportData.DataSource = _Report_GA.MAIN_REPORT; this.dgvSummary.DataSource = _Report_GA.SUMMARY; #region Stylize the DataGridViews //DataGridViewCellStyle defaultCellStyle1 = new DataGridViewCellStyle(); //defaultCellStyle1.Padding = new Padding(0,0,0,0); //defaultCellStyle1.Font = new Font("Arial", 8F); //DataGridViewCellStyle defaultCellStyle2 = new DataGridViewCellStyle(defaultCellStyle1); //defaultCellStyle2.BackColor = Color.LightCyan; //this.dgridView_ReportData.DefaultCellStyle = defaultCellStyle1; //this.dgridView_ReportData.AlternatingRowsDefaultCellStyle = defaultCellStyle2; //this.dgridView_ReportData.CellBorderStyle = DataGridViewCellBorderStyle.None; //this.dgridView_ReportData.RowHeadersVisible = false; // Above Code moved to Static Method MyAllocator1.ReportUI.ReportStyles.Set_DefaultDataGridViewStyle(dgridView_ReportData); #endregion #region Update The Form Caption int index = this.lblTitle.Text.IndexOf('\n'); if (index > 0) this.Text = this.lblTitle.Text.Substring(0, index); else if (this.lblTitle.Text.Length > 0) this.Text = this.lblTitle.Text; else this.Text = "Allocation Report for Guarantor: " + Guarantor; #endregion } catch (Exception exc) { PU.MB = exc.Message; } }