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

4 comments:

  1. Thanks for sharing.

    Pooja

    MLM Developers India

    http://mlmdevelopers.com/products/mlm-software/corporate-mlm-soft/feature.html

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

    ReplyDelete
  3. MD.Shameem Mridha
    This something very unique and helpful for me!! Thanks a lot. Everything explained in so simple way.

    ReplyDelete

  4. 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