Dear friend's
i create an application with c# contain 2 form's
the first is a formulare with a datagridview ( i upload the values manual with a textbox)
in the second form i have a crystal report
now all what i need is to passing the datagridview values to the crystal report in the secand form
i make all the textbox's showing in the crystal i just need to display the values of datagridview to my report.
Sanwar RanwaPosted Sep 12, 2018, 7:53 AM
objRpt = new my_rpt();
DataTable dt = (DataTable)dataGridView1.DataSource;
if( dt != null)
{
if( dt.Rows.Count > 0)
{
DataSet Ds = new DataSet();
ds.Tables.Add(dt);
objRpt.SetDataSource(Ds);
}
}
DataTable dt = (DataTable)dataGridView1.DataSource;
and Pass it dataTable Into Rteport Source
MOHSEN BENAISSAPosted Sep 12, 2018, 8:07 AM