private void btnPrintAll_Click(object sender, EventArgs e) { try { new PrompteForm().ShowDialog(); if (PrompteForm.Year != "") { DataSet ds = Class_Fees.usp_PrintAllFees(PrompteForm.Year); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("لا توجد أي بيانات لهذه السنة", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { this.Cursor = Cursors.WaitCursor; RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); RPT.AllFees cr = new RPT.AllFees(); cr.SetDataSource(ds); cr.SetParameterValue("Year", PrompteForm.Year); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } } } catch (Exception) { this.Cursor = Cursors.Default; //throw; } }
private void btnMu_Click(object sender, EventArgs e) { try { DataSet ds = Class_student.ups_getMofStudent(dataGridView1.SelectedRows[0].Cells[0].Value.ToString(), dataGridView1.SelectedRows[0].Cells[15].Value.ToString()); RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); RPT.CR_MUPaper rapport = new RPT.CR_MUPaper(); rapport.SetDataSource(ds); frm.crystalReportViewer1.ReportSource = rapport; frm.ShowDialog(); } catch (Exception ex) { //MessageBox.Show(ex.Message); } }
private void btnPrint_Click(object sender, EventArgs e) { if (FeeId > 0) { try { this.Cursor = Cursors.WaitCursor; DataSet ds = Class_Fees.usp_getRecu(FeeId); RPT.CrystalReport1 cr = new RPT.CrystalReport1(); cr.SetDataSource(ds); RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show("حصل خطأ في جمع البيانات", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnPrintSelected_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { try { this.Cursor = Cursors.WaitCursor; int FeeId = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); DataSet ds = Class_Fees.usp_getRecu(FeeId); RPT.CrystalReport1 cr = new RPT.CrystalReport1(); cr.SetDataSource(ds); RPT.FRM_REPORT frm = new RPT.FRM_REPORT(); frm.crystalReportViewer1.ReportSource = cr; frm.ShowDialog(); this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show("حصل خطأ في جمع البيانات", "إشعار", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }