locked
Report has no table in crystal report in asp.net. RRS feed

  • Question

  • User-808216843 posted

    HI,

    i am just making a simple code to show some data in crystal report in asp.net but when  rd.SetDataSource(ds.Tables["abc"]); code is executing so its giving error that report has no tables...   i searched on google but nothing helped me yet..

    plz can anyone tell me that why i am getting this error and whats solution of this...

    I will really appreciate that.. Here is my code :: 

            OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings["CnStr1"].ConnectionString);
    con.Open();
    ds = new DataSet();
    string qry = "";
    qry = "select clname from clmaster where createdate = '" + TextBox1.Text + "'";
    da = new OracleDataAdapter(qry, con);
    da.Fill(ds, "abc");
    Session["ab"] = ds.Tables["abc"];
    rd = new ReportDocument();
    rd.Load(Server.MapPath("~/CrystalReport.rpt"));
    rd.SetDataSource(ds.Tables["abc"]); ---> This Line is giving error that report has no table.
    CrystalReportViewer1.ReportSource = rd;
    
    
    Plz help me!!!!!!!!!
    Tuesday, August 16, 2011 11:53 AM

All replies

  • User1594475756 posted

    hi,

     You try insted of that line rd.SetDataSource(ds). I hop e its working .

    Wednesday, August 17, 2011 2:19 AM
  • User2131854062 posted

    Hi Jiten

    Plase Allpy This Line

     rd.SetDataSource(ds,"abc");



    thanks

    Wednesday, August 17, 2011 4:35 AM
  • User1594475756 posted

    Insted of  ["abc"] u hav e to use ur table name. I hope its working

    Wednesday, August 17, 2011 8:45 AM
  • User-1011137159 posted

    This error is causing because of your crystal report you have not added any tables that can be bind with your dataset. So change in your rtp file.

    Wednesday, August 17, 2011 9:40 AM
  • User-808216843 posted

    Hey Thanks for giving me right direction..  i did that and made Dataset and now i am not getting that error but hey tell me one thing when data is showing into the report and when i am watching the next page so its asking for entering the DataSource, DataBaseName, UserID, Password. Even i have set all these things in Page_Init event but still i am getting that thing..

    Hey whats that and what i have to do for making it working fine...

    Plz tell me, i really appreiciate reply...

    Wednesday, August 17, 2011 1:55 PM