Simple Report (Not a Crystal Report)

H

halaor

I have my data filled in a DataTable, generated on runtime.

I have a DataSet, into this DataSet i add my DataTable

dataSet1.Tables.Add(datatable);

Now I would like to show this simple table as a Report in a
ReportViewer, so that user can print it out.

In the Report.rdlc, i inserted from the Toolbox a Table table1.

Now I get the error:
The table ‘table1’ is in the report body but the report has no data set.
Data regions are not allowed in reports without datasets.

I don't know, how i can "bind" my DataSet or DataTable to this Report.

Anyone can help me?

Thanks
 
W

www.bypsoft.com

You should define Microsoft.Reporting.WinForms.ReportDataSource and assign
Name and Value for it and than add it to the ReportViewer controls
LocalReport.DataSource. The best will be to take a look a tutorial video at
http://perseus.franklins.net/msnewengland/reportviewer.htm
and the code generated in InitializeComponent. Of course, this is applicable
if you are generating local report (server reports are even easier).

rgds,
dlm,
www.bypsoft.com
cross-database comparison and synchronisation tools
DBTYP.NET - see differences for free
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top