Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: CrystalReportViewer doesn't display data in repor Post Reply Post New Topic
Author Message
krunalkakadia
Newbie
Newbie


Joined: 10 Aug 2011
Location: India
Online Status: Offline
Posts: 1
Quote krunalkakadia Replybullet Topic: CrystalReportViewer doesn't display data in repor
    Posted: 10 Aug 2011 at 11:32pm
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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.