Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crystal report viewer next page not working

I am using visual studio 2010 and crystal report 13.0

The report viewer displays the first page properly. But the next page button is not working. If i click on next page button then it shows loading message and stays there only.None of the report viewer controls are working.

please help me out

like image 678
Spider man Avatar asked Dec 26 '22 12:12

Spider man


1 Answers

I found the solution. Manually add the Page_Init() event and wire it up in the InitializeCompnent() with

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

Move the contents of Page_Load to Page_Init().

Add if (!IsPostBack) condition in 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;
        }
   }
like image 72
Spider man Avatar answered Jan 05 '23 10:01

Spider man