0
我是新來報告viwer,我想知道如何將select參數傳遞給報表查看器和數據源?我需要將開始日期和結束日期傳遞給數據源以過濾數據,並在報告查看器中顯示。任何人建議?ASP.NET C#reportviewer參數
> <rsweb:ReportViewer ID="Log_ReportViewer" runat="server" Height="545px" Width="962px" Font-Names="Verdana" Font-Size="8pt"
> WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
> <LocalReport ReportPath="Reporting\ReportRDLC File\LogReport.rdlc">
> <DataSources>
> <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="Log" />
> </DataSources>
> </LocalReport>
> </rsweb:ReportViewer>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:InvControlConnectionString %>"
> ProviderName="<%$
> ConnectionStrings:InvControlConnectionString.ProviderName %>"
> SelectCommand="SELECT * FROM logs WHERE log_createDate >= startDate AND log_createDate >= endDate">
> <SelectParameters>
> <asp:QueryStringParameter Name="endDate" QueryStringField="endDate" />
> <asp:QueryStringParameter Name="startDate" QueryStringField="startDate" />
> </SelectParameters>
> </asp:SqlDataSource> </asp:Content>
嗨,我之前嘗試此代碼,但它告訴我LocalProcessingException在代碼的最後一行。 –
@FirionRedfield請分享異常消息。 –
Microsoft.ReportViewer.WebForms.dll中發生類型爲「Microsoft.Reporting.WebForms.LocalProcessingException」的異常,但未在用戶代碼中處理 –