Crystal report Error: Report has no tables
-
I am trying to generate simple Crystal Report. To do so I have configured datas set and i have set this data set as reports's data source. If I check the table name of data set then It gives that right. But on the next line where I have set this dataset as report's data source it gives Error "Report has No tables" Code is as follow: Dim i As New CrystalReport1 Dim ds As New System.Data.DataSet Dim ObAdp As New SetDatasetClass' here dataset get configured ds = ObAdp.getDataset("Select * from Employee" ) MsgBox(ds.Tables(0).TableName)' Shows table name as Employee i.SetDataSource(ds.Tables(0)) Is the method is right?
-
I am trying to generate simple Crystal Report. To do so I have configured datas set and i have set this data set as reports's data source. If I check the table name of data set then It gives that right. But on the next line where I have set this dataset as report's data source it gives Error "Report has No tables" Code is as follow: Dim i As New CrystalReport1 Dim ds As New System.Data.DataSet Dim ObAdp As New SetDatasetClass' here dataset get configured ds = ObAdp.getDataset("Select * from Employee" ) MsgBox(ds.Tables(0).TableName)' Shows table name as Employee i.SetDataSource(ds.Tables(0)) Is the method is right?
I think you are not set any table to CrystalReport1 at design time. If Yes then,Let me explain how can you set the table for report 1 Open Report CrystalReport1 in IDE. 2.From the Field Explorer window,Right click on Database Fields and Select Database Expert option (Or you can also Select the 'Database Expert' option from Menu CrystalReports-->Database) 3.A new window is open(Database Expert) from which you can select the Table(Employee) for you Report and click on OK button. 4. Now in Field Explorer window, A + sign is appear in Front of 'Database Fields' Option. Expand this sign 5. After expanding, Employee table is appear which you select in Database Expert window. 6. Place fields of Employee table in Appropriate section of Crystal Report 7.Now run you application Hope this helps
Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company