如何在ReportViewer中启用分页?

时间:2013-09-30 10:01:30

标签: asp.net asp.net-mvc report-viewer2010

使用分页时,我的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);

数据显示正确,但分页不起作用。我很感激任何帮助!

0 个答案:

没有答案