I am developing an ASP.NET Application in which i want to fill datatable from database, set it to the crystal report source, and then display that report. Here is my code to do it:

if (testObj.TestTable.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr[0] = testObj.TestTable.Rows[0][1].ToString();
                dr[1] = testObj.TestTable.Rows[0][2].ToString();
                dr[2] = testObj.TestTable.Rows[0][4].ToString();
                dt.Rows.Add(dr);
                testReport
                     rpt = new testReport();
                rpt.SetDataSource(dt);
                CrystalReportViewer1.ReportSource = rpt;


            }

but it never display any report in the report viewer. can anyone help me to sort this?

Related posts

Recent Viewed