-
- A data source instance has not been supplied for the data source ‘<the_data_set>’
If you receive this error, then you are likely missing a line in your ReportViewer declaration in your .aspx file.
Look for:
<LocalReport ReportPath="reports\Custom_Folder\report.rdlc"> </LocalReport>
change it to:
<LocalReport ReportPath="reports\Custom_Folder\report.rdlc"> <DataSources> <rsweb:ReportDataSource DataSourceId="<the_ObjectDataSource_ID>" Name="<the_data_set>" /> </DataSources> </LocalReport>
If the error message doesn’t make it clear (or if you receive a similar but different message), here’s how you find out what you need:
<the_ObjectDataSource_ID> — you dropped an ObjectDataSource in the .aspx file. What is its ID? If you don’t remember, look for the line in your .aspx file like this:
<asp:ObjectDataSource ID="<the_ObjectDataSource_ID>" runat="server"
<the_data_set> — in the .rdlc file, you added a data source in the Report Data window. This is the name of that data set (not the data source, as the error implies.) If you don’t remember, open the .rdlc, and open the Report Data view (on the left, same place as Server Explorer and Toolbox). You’ll see an icon looking like a database cylinder with a key (this is the Data Source, but that’s not what we’re looking for.) Within that is an icon that looks like a data table. This is the Data Set, and the name you’re looking for.
0
0