Last post Apr 11, 2014 03:04 AM by Juanan
May 08, 2008 09:31 AM|robarahz|LINK
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.
May 08, 2008 09:52 AM|robarahz|LINK
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....
May 08, 2008 12:45 PM|robarahz|LINK
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.
Jan 16, 2009 10:48 PM|jayachitra|LINK
Hope it helps someone.
Thank you a lot. It helped me to fix up the same issue.
Jan 22, 2009 01:34 AM|wasif.jahangir|LINK
Jan 23, 2009 02:00 PM|aymanpvt|LINK
did you call report binding inside Not Page.IsPostBack ? like
If Not Page.IsPostBack Then
Sep 09, 2009 04:11 AM|jawwadalam|LINK
I was facing the same issue. I resolved my issue by Turning the View State on. In my case the view state was turned off for all pages of the website using the web.config.
i ve put all of binding logic in page_init method but haven't got desired results. i.e. i can come from page 1 to 2 but not on page 3 by hitting next button. kindly if u can help me out by some sample code/Reference.
May 26, 2010 11:50 AM|sheikhusmanshakeel|LINK
Thanx man, it helped me a lot too...
the sample code in C# is something like so...
protected void Page_Init(object sender, EventArgs e)
// do all your reporting stuff here, then add it to session like so
ReportDocument crystalReportDocument = new ReportDocumment();
//_reportViewer is the crystalviewer which you have on ur aspx form
_reportViewer.ReportSource = crystalReportDocument;
Session["ReportDocument"] = crystalReportDocument;
ReportDocument doc = (ReportDocument)Session["ReportDocument"];
_reportViewer.ReportSource = doc;
hope this helps
Jul 29, 2010 05:16 AM|Sandeep_1111|LINK
Thanks guys it solved my problem too.
i also faced the same problem with navigation
Sep 13, 2010 04:32 PM|agraspnet|LINK
I was having the same problem, and I solved it installing the Crystal Reports for VS 2008 SP1.
the name of the file is crbasic2008sp1.exe and can be downloaded from the following link:
I hope this can help somebody.
Dec 22, 2010 12:24 PM|bali27|LINK
Thank you so much!
I downloaded the CR SP1 for VS2008 as you stated and now my page advances the correctly.
Crystal reports viewers .net not advancing pages past page 2
Jun 20, 2012 08:15 AM|abdul1585|LINK
My Problem Is Solved.................................................Abdul1585
May 30, 2013 07:29 AM|ashishshri|LINK
I installed the exe which you specified ,for me all the navigation button is working fine,except "Last" navigation button,I can click next,Previous and First and go to last page also,but if I click Last button it refreshes and remain in same page,You
have any idea how can I solve it.
Apr 11, 2014 03:04 AM|Juanan|LINK
Page_Init worked for me. Thanks :-)