0 down vote favorite
I'm currently trying to dynamically send an rdl report to my ReportViewer .net object.
I keep getting the error when I do it: A data source instance has not been supplied for the data source "blah"
I'm trying to define "blah" in my code behind at runtime.
Code
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = ReportFile;
ReportViewer1.LocalReport.DataSources.Clear();
Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource();
rds.Name = "blah";
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.DocumentMapCollapsed = true;
ReportViewer1.LocalReport.Refresh();this is not working by a long shot. I'm not sure what I'm supposed to do. here is an extract of the top of my rdl file:
Code
Name="blah">
c6a8409e-71a4-4e96-86ad-b300a5b942c3
SQL
Data Source=10.555.121.121;Initial Catalog=blah
trueAll I'm trying to do is simply select * from a table in "blah" in my report. I need this to work because I have many other report instances I need to show inside my ReportViewer. Why doesn't Microsoft make this easier?
Thanks in advance anybody...

Sam HobbsRank #107 · 20.5K reputationPosted Oct 26, 2010, 9:31 PM EDT
Lyle Griess13 reputationPosted Oct 27, 2010, 7:10 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Oct 27, 2010, 10:14 AM EDT
I have worked with reports such as that. I use the interactive interface though; I don't edit the XML directly. You should try using the interactive interface in Visual Studio; it is probably called the designer.
I admit that I don't know anything about your data source. That's the problem; you only show the part that is not working. So instead of spending a lot of time asking for clarification I told you what I would do.
Lyle Griess13 reputationPosted Oct 28, 2010, 7:16 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Oct 28, 2010, 9:18 AM EDT