使用分页时,我的 ReportViewer 无法正常工作。当我单击下一页时,它只显示第一页(有几页)。有什么问题?reportViewer 的版本是最新的。
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SchetReestrDataSet", Model));
LocalReport LocalReport = ReportViewer1.LocalReport;
}
}
<form id="form1" runat="server" >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" InteractiveDeviceInfos="(Коллекция)" style="margin-bottom: 0px; width: 100%;"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
AsyncRendering ="false">
<LocalReport ReportPath="Views\Reports\ReportSchetReestr\Report.rdlc">
</LocalReport>
</rsweb:ReportViewer>
</form>
模型数据从控制器传递:
IEnumerable data = _unitOfWork.SchetReestrRepo.GetData(...//parameters);
return View(data);
数据显示正确,但分页不起作用。我会很感激任何帮助!