private void buttonPrintitemsGrid_Click(object sender, EventArgs e) { var crp = new Reports.itemsGridReport(); var form = new PrintForm(); crp.SetDataSource(dataGridView_displayitems.DataSource); form.crystalReportViewer1.ReportSource = crp; form.ShowDialog(); }
private void buttonPrintitemsGrid_Click(object sender, EventArgs e) { var crp = new Reports.itemsGridReport(); var form = new PrintForm(); if (dataGridView_displayitems.Rows.Count > 0) { crp.SetDataSource(dataGridView_displayitems.DataSource); form.crystalReportViewer1.ReportSource = crp; form.ShowDialog(); } else { MessageBox.Show("لا توجد بيانات لعرضها", "MESSAGE"); } }