Last post May 25, 2013 12:13 AM by Avneesh Srivastava
May 13, 2013 09:36 AM|Avneesh Srivastava|LINK
This is the first time I'm working with crystal reports. What i am trying to do is crating a single crystal report which populated at runtime using with select command therefore I write the code onload event of page My code is-
ReportDocument cryRpt = new ReportDocument();
adp = new SqlDataAdapter("Select * from Store_Purchasebill where Bill_no=" + bill + "", con);
DataSet ds = new DataSet();
if (ds.Tables.Rows.Count > 0)
cryRpt.SetDataSource(ds.tables);// here i get error
crystalReportViewer1.ReportSource = cryRpt;
catch (Exception se)
The error it show is report has no tables. I added a blank Crystal report if i need to add another type of report then plz tell me how to add that.
Thx in advance.
May 13, 2013 11:47 AM|Neodynamic|LINK
Try replacing this line:
by this one:
May 13, 2013 01:56 PM|Avneesh Srivastava|LINK
Thx dear but I already try that.
May 22, 2013 03:57 AM|itityagi|LINK
Have you created the dataset of the reports?
You need to create a dataset, which contains the datatable which holds all the columns in of your report?
Try adding a new item, then choose dataset, name it.
Open the dataset, make a new datatable for the report, give the columns name same name and then in the field explorer of the report,
add a connection by choosing the dataset from the directory.
This is how I do.
Now after looking at your code, it seems that yur table is not created, so try making datatable properly.
May 23, 2013 11:56 PM|Avneesh Srivastava|LINK
Thx itityagi its work.
One more question
for every report i have to follow this whole procedure??
May 24, 2013 09:29 AM|itityagi|LINK
Yes as for every report, you might have different fields, I mean the columns to show, so you need to make a seperate datatable in the dataset.
We have a single dataset, but for every report, we have different datatable, so you will have the same dataset, but multiple datatables.
datatable 1 for report 1 // same dataset
datatable 2 for report 2 //same dataset
May 25, 2013 12:13 AM|Avneesh Srivastava|LINK
ok thx sir.