Crystal Report viewer navigation buttons not working

Last post 05-08-2008 12:45 PM by robarahz. 2 replies.

Sort Posts:

  • Crystal Report viewer navigation buttons not working

    05-08-2008, 9:31 AM
    • Loading...
    • robarahz
    • Joined on 04-21-2008, 3:31 PM
    • Posts 12

    Working in Visual Studio 2008 and using the packaged Cystal Reports (version 10.5). I have a couple pages that use the Crystal Reports Viewer to display the reports, and I use the CRV navigation buttons to page through large reports.

    Problem: The Next button only goes to page 2. The Previous button goes to Page 1 every time.

    I've read that this is because the binding of the report occurs in the Page_Load() and the CRV paging resets every time the report is rebinded. It was suggested to move this into Page_Init() which should only fire once, save the report in Session state, and then rebind on post backs. I've tried this, but my code never seems to reach the Page_Init(). In fact, I don't even see Page_Init() as an option. I've tried protected override OnInit(), but it fires every post back so that's no good.

    Does anyone have suggestions for a solution?

    Where is Page_Init() in Visual Studio 2008?

     Thanks for any help.

     -Robert

     

     

  • Re: Crystal Report viewer navigation buttons not working

    05-08-2008, 9:52 AM
    • Loading...
    • robarahz
    • Joined on 04-21-2008, 3:31 PM
    • Posts 12

    OK, I found the Page_Init() issue...I manually add the event, but I forgot to wire it up in the InitializeCompnent() with this.Init += new System.EventHandler(this.Page_Init).

    Now I'll see if I can get the nav buttons working by moving the report binding into there....

     

  • Re: Crystal Report viewer navigation buttons not working

    05-08-2008, 12:45 PM
    • Loading...
    • robarahz
    • Joined on 04-21-2008, 3:31 PM
    • Posts 12

    OK, it took some fiddling, but moving the code to Page_Init() seems to work. Now I can navigate correctly.

    To recap, I was getting my dataset, binding it to the report, and binding the report to the viewer, all in Page_Load. I moved that to Page_Init() and the viewer's navigation buttons work (Next and Previous specifically).

    Hope it helps someone.

     

     

Page 1 of 1 (3 items)