Hi friends can any one help me how to pass data from datagridview to crystal report
Thanks
Znaneswar
Pass data from gridview to crystal report
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal VaishyaRank #990 · 2K reputationPosted Jun 22, 2012, 11:25 PM EDT
DataTable dt = (DataTable)dataGridView1.DataSource;
and Pass it dataTable Into Rteport Source
Gohil JayendrasinhRank #490 · 5K reputationPosted Jun 24, 2012, 10:33 PM EDT
// Creating object of our report.
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);
}
}