krunalkakadia 0 Light Poster

hi all,

i am generating crystal report. i am using sql server 2008 and VS 2008. problem is that data isn't printing in report.

ReportDocument rptdoc = new ReportDocument();
private void bindreport()
    {
        con.Open();

        string filepath = Server.MapPath("~/")+"Reports/SampleCrystalReport.rpt";
        rptdoc.Load(filepath);
        
        DataTable dt = new DataTable();
        SqlCommand cmd = new SqlCommand("select * from tblEmp", con);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.Fill(dt);
        if (dt.Rows.Count != 0)
        {
            rptdoc.SetDataSource(dt);
            CrystalReportViewer1.ReportSource = rptdoc;
            CrystalReportViewer1.DataBind();
        }
        con.Close();
    }

i can get data at CrystalReportViewer1.ReportSource = rptdoc; but data can't display in report.

Thanks,
Krunal