DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("proname", typeof(string));
dt.Columns.Add("price", typeof(decimal));
dt.Columns.Add("quantity", typeof(decimal));
dt.Columns.Add("total", typeof(decimal));
foreach (DataGridViewRow dgv in dataGridView1.Rows)
{
dt.Rows.Add(dgv.Cells[1].Value, dgv.Cells[4].Value, dgv.Cells[6].Value, dgv.Cells[7].Value);
}
ds.Tables.Add(dt);
ds.WriteXmlSchema("Print.xml");
this.dataGridView1.DataSource = null;
this.dataGridView1.Rows.Clear();
txtamountnumber.Text = "";
CrystalReportSells cr = new CrystalReportSells();
cr.SetDataSource(ds);