iinf

iinf

  • NA
  • 19
  • 0

Crystal Reports populating problem

Nov 24 2006 7:19 AM
Dear friends, I want to populate dataset and display it into Crystal report viewer. I am working in c# in Visual Studio 2005. I have even draged and drop crystal reportviewer control. But the error it is giving "The report has no tables." and point to dataset Even though by placing break point I am able to see data in dataset. Following is the code: String conn = "Provider = Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=sma;Data Source = dbbusiness.mdb"; OleDbConnection Connection = new OleDbConnection(conn); Connection.Open(); DataSet dataReport1 = new DataSet(); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter("SELECT item,quantity,price FROM sales WHERE billno='" + textBox1.Text + "'", Connection); myDataAdapter.Fill(dataReport1, "sales"); DataTable dtable = new DataTable("sales"); dataReport1.Tables.Add(); CrystalReport1 oRpt = new CrystalReport1(); oRpt.SetDataSource(dataReport1); crystalReportViewer1.Visible = true; crystalReportViewer1.ReportSource = oRpt; Connection.Close(); Please help me.

Answers (2)