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

2 comments:

  1. Great article, Thanks for your nice knowledge, the content is quiet attention-grabbing. i will be expecting your next post.

    ReplyDelete

  2. Thank Mridha ITyou, I’ve just been searching for information about this topic for a while and yours is the greatest I’ve discovered till now.

    ReplyDelete