How to bind a DataSet to a ReportViewer object?

  • Thread starter Gordana via DotNetMonster.com
  • Start date
G

Gordana via DotNetMonster.com

I use DataSet which I get from Web Service and it doesn't maintain an active
connection to the database. So that I can't populate table in Report.rdlc
dragging fields from the DataSets window to the some rows in the table. I
want to display DataTable from the DataSet via the new ReportViewer. I tryed
something like this, but it doesn't work.

reportViewer2.ProcessingMode = ProcessingMode.Local;
reportViewer2.LocalReport.ReportPath = "Report1.rdlc";
reportViewer2.LocalReport.DataSources.Add(new ReportDataSource("DOH",
GetData2(inputFile))); //GetData2(inputFile) returns the datatable
reportViewer2.RefreshReport();

Am I missing something?
 

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