水晶报告查看器下一页不工作

Spi*_*man 3 asp.net crystal-reports

我正在使用visual studio 2010和13.0水晶报告

报告查看器正确显示第一页.但下一页按钮不起作用.如果我点击下一页按钮然后它显示加载消息并且只保留在那里.没有任何报告查看器控件正在工作.

请帮帮我

Spi*_*man 7

我找到了解决方案.手动添加Page_Init()事件,并将其连接起来在InitializeCompnent()

this.Init += new System.EventHandler(this.Page_Init).

将内容Page_Load移至Page_Init().

添加if (!IsPostBack)条件PageInIt.

protected void Page_Init(object sender, EventArgs e)
{

        if (!IsPostBack)
        {
             ReportDocument crystalReportDocument = new ReportDocumment();
             crystalReportDocument.SetDataSource(DataTableHere);
             _reportViewer.ReportSource = crystalReportDocument;
             Session["ReportDocument"] = crystalReportDocument;
        }
        else
        {
              ReportDocument doc = (ReportDocument)Session["ReportDocument"];
              _reportViewer.ReportSource = doc;
        }
   }
Run Code Online (Sandbox Code Playgroud)