private void button5_Click(object sender, EventArgs e) { BorrowerReport b = new BorrowerReport(); BorrowerReport.data = new string[dataGridView1.Rows.Count, 3]; for (int x = 0; x < dataGridView1.Rows.Count; x++) { BorrowerReport.data[x, 0] = dataGridView1.Rows[x].Cells[0].Value.ToString(); BorrowerReport.data[x, 1] = dataGridView1.Rows[x].Cells[1].Value.ToString() + " " + dataGridView1.Rows[x].Cells[2].Value.ToString() + " " + dataGridView1.Rows[x].Cells[3].Value.ToString(); BorrowerReport.data[x, 2] = dataGridView1.Rows[x].Cells[4].Value.ToString(); } BorrowerReport.length = dataGridView1.Rows.Count; BorrowerReport.type = comboBox1.Text; b.ShowDialog(); }
private void button5_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { BorrowerReport b = new BorrowerReport(); BorrowerReport.data = new string[dataGridView1.Rows.Count, 3]; for (int x = 0; x < dataGridView1.Rows.Count; x++) { BorrowerReport.data[x, 0] = dataGridView1.Rows[x].Cells[0].Value.ToString(); BorrowerReport.data[x, 1] = dataGridView1.Rows[x].Cells[1].Value.ToString() + " " + dataGridView1.Rows[x].Cells[2].Value.ToString() + " " + dataGridView1.Rows[x].Cells[3].Value.ToString(); BorrowerReport.data[x, 2] = dataGridView1.Rows[x].Cells[4].Value.ToString(); } BorrowerReport.length = dataGridView1.Rows.Count; BorrowerReport.type = comboBox1.Text; b.ShowDialog(); } else { MessageBox.Show("Empty Records", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button5_Click(object sender, EventArgs e) { BorrowerReport b = new BorrowerReport(); b.ShowDialog(); }