views:

395

answers:

2

I had posted this question on MSDN Forum

http://social.msdn.microsoft.com/Forums/en/vsreportcontrols/thread/f00e3406-354d-4f54-acce-7b7f0ad4c90f

But I am not getting any response. Can you please help me. I am really stuck with this rather simple task.

My code seems to be correct but still I get the

A data source instance has not been supplied for the data source 'DataSet1_Order_Details'.

Sorry for the cross post...

A: 

I had a same experience and it was because I try tosee the report from a wrong place, let me explain

  • There is a dataSet in RDLC reports
  • There is a method in DAL which get data from db
  • There is a Method in BAL or UI which call the DAL method and fill dataset. Most of time this is a unique page which get some parameter from user and fill dataset and finally redirect user to the report viewer page.
  • your eror appears in report viewer page

So the following may happened

  • you enter directly to reportviewer page without filling dataset
  • you went to correct page and fill the dataset but inreport viewer pageyoudidn't bind your dataset to your report in code behind.
  • in some cases it can be because of session expiration.
Nasser Hadjloo
I have not entered the report viewer without populating the dataset.my first report appears perfectly. when I click on the link, I have the drill through event handler where I make every possible effort to populate the dataset. have a look at the code which I have posted and also the screenshots.
Knows Not Much
A: 

I solved the error.

I was adding the data source like this.ReportViewer.Localreport.DataSource.Add(new RemoteDataSource("DataSet1_Order_Details", ObjectDataSource2.ID));

instead the data source should be added in the following manner

DataSet1TableAdapter.OrderDetails od = new DataSet1TableAdapter.OrderDetails(); ((LocalReport)e.report).Datasources.Add(new RemoteDataSource("DataSet1_Order_Details", od.get(orderid))

this resolved the issue and now I am able to have drill down in the ReortViewer report.

Regards, Abhishek

Knows Not Much