why crystal report displays empty fields with no data . Why dynamic binding is not happening .

here in my case

Cat_id     cat_Name is displayed no values under it is displayed

code:

 protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = oclsdbcon.Getconnection();
        con.Open();

        DataSet1 ds = new DataSet1();
        string str = "select Cat_Id,Cat_Name from Category_Det";

        SqlDataAdapter da = new SqlDataAdapter(str, con);

        da.Fill(ds,"DataSet1"); // DataSet1 is the DataSet1.xsd which i created and i have dragged and dropped a 
        // table category det into DataSet1 screen.

        ReportDocument rep = new ReportDocument(); // Although i have the crystalreport.rpt embedded into my website
        // still i am unable to create an object using it, so i am using this way
        rep.Load(Server.MapPath("CrystalReport.rpt"));
        rep.SetDataSource(ds ); // in the ds datasetview i have DataSet1 with values for catid and catname

        CrystalReportViewer1.ReportSource = rep ; // here i didnt know how to check the contents of rep but crystal  report viewer is not displaying any values under it .

        CrystalReportViewer1.DataBind();

    }

I got the answer , I am very happy , Thank god

When you scream for help, shouldn't you put your solution when you find one?

And at least mark the thread solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.