我有一个绑定到 LinqDataSource 的可用性报告查看器控件:
<MyReport:ReportViewer ID="rvAvailabilty" runat="server" >
<LocalReport>
<DataSources>
<MyReport:ReportDataSource DataSourceId="ldsAvailabiltyRows" Name="DataSetAvailabilty" />
</DataSources>
</LocalReport>
</MyReport:ReportViewer>
<asp:LinqDataSource ID="ldsAvailabiltyRows" runat="server" ContextTypeName="MyApp.MyDataContext" EntityTypeName="MyApp.AvailabiltyRow" OnSelecting="ldsAvailabiltyRows_Selecting" >
</asp:LinqDataSource>
在后面的代码中,我指定了一个存储库调用以返回一组有序(按字母顺序)的行。存储库中的顺序是正确的。
public void ldsAvailabiltyRows_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
e.Result = repo.GetReportAvailabiltyRows(); // this repository call returns the correctly ordered data set
}
但是,生成报表时,数据集的顺序对报表不起作用。如何在我的报告中强制执行正确的从上到下的顺序?