所以我在visual studio中制作了一个数据集和图表。然后我将报表查看器添加到页面并添加了数据源实例。但是当我运行页面时,我收到一个错误:"没有为数据源提供数据源实例' DataSet1'"
这是我的sql查询的代码,它是数据源实例和reportviewer的代码。
<rsweb:ReportViewer ID="rptpassfails" runat="server" Font-Names="Verdana" Font-Size="8pt" ShowBackButton="False" ShowFindControls="False" ShowPageNavigationControls="False" ShowZoomControl="False" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
<LocalReport ReportPath="Reports\chart_passfails.rdlc" DisplayName="dspassfail" ReportEmbeddedResource="Qsis.Reports.chart_passfails.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="sqlpassfail" Name="passfail" runat="server"/>
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="sqlpassfail" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"
SelectCommand="SELECT
StudentModule.StudentPassFailModule
,[Module].ModuleCode
,Course.CourseName
,Course.School
,Course.EntryYear
FROM
[Module]
INNER JOIN StudentModule
ON [Module].ModuleId = StudentModule.ModuleId
INNER JOIN Course
ON [Module].CourseId = Course.CourseId
Where Course.CourseName=@course AND Course.EntryYear=@entryyear">
<SelectParameters>
<asp:QueryStringParameter Name="entryyear" QueryStringField="entryyear" Type="String" />
<asp:QueryStringParameter Name="course" QueryStringField="course" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
对此的任何帮助将不胜感激!