CrystalReports-Error

Posted by Dn2010 under ASP.NET on 1/13/2011 | Points: 10 | Views : 2908 | Status : [Member] | Replies : 1
hi friends,

Error CrystalReports.Engine.DataSourceException: The report has no tables

SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
OpenConnection(con);
cmd.Connection= con;

string sql = "SELECT * from empreg";
SqlDataAdapter myDA = new SqlDataAdapter(sql, con);

ReportDocument rpt = new ReportDocument();
DataSet myDS = new DataSet();

rpt.Load(Server.MapPath("emp.rpt"));
myDA.Fill(myDS,"empreg");

rpt.SetDataSource(myDS);
CrystalReportViewer1.ReportSource = rpt;

The report has no tables.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.DataSourceException: The report has no tables.

Source Error:

Line 84: myDA.Fill(myDS,"empreg");
Line 85:
Line 86: rpt.SetDataSource(myDS);
Line 87: CrystalReportViewer1.ReportSource = rpt;
Line 88:

Thanks.




Responses

Posted by: Karthikanbarasan on: 1/14/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Did you checked that ur dataset has been filled with the table values??? or it comes as an empty dataset?

Thanks
Karthik
www.f5Debug.net

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response