Tuesday, August 31, 2010

Crystal Reports for Web Paging Problem

Noticed how the paging of Crystal Reports for Visual Studio works, that when the report is more than 2 pages, the navigator gets stuck at page 2?



Here's a simple solution.
If the ReportDocument loading codes are placed in the Page_Load event of the page...


protected void Page_Load(object sender, EventArgs e)
{
    .
    .
    .
    ReportViewer.ReportSource = reportDocument;
}

...create a new Page_Init event and move the codes there.


protected void Page_Init(object sender, EventArgs e)
{
    .
    .
    .
    ReportViewer.ReportSource = reportDocument;
}


Now the paging will work as intended.









-elyk