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.
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....
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).
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.
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.
wasif.jahangir
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.
protected void Page_Init(object sender, EventArgs e)
{
if (!IsPostBack)
{
// do all your reporting stuff here, then add it to session like so
ReportDocument crystalReportDocument = new ReportDocumment();
crystalReportDocument.SetDataSource(DataTableHere);
//_reportViewer is the crystalviewer which you have on ur aspx form
_reportViewer.ReportSource = crystalReportDocument;
Session["ReportDocument"] = crystalReportDocument;
}
else
{
ReportDocument doc = (ReportDocument)Session["ReportDocument"];
_reportViewer.ReportSource = doc;
}
}
hope this helps
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.
None
0 Points
12 Posts
Crystal Report viewer navigation buttons not working
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.
-Robert
None
0 Points
12 Posts
Re: Crystal Report viewer navigation buttons not working
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....
None
0 Points
12 Posts
Re: Crystal Report viewer navigation buttons not working
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.
Member
2 Points
35 Posts
Re: Crystal Report viewer navigation buttons not working
Jan 16, 2009 10:48 PM|jayachitra|LINK
Dear Robarahz
Thank you a lot. It helped me to fix up the same issue.
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
Jan 22, 2009 01:34 AM|wasif.jahangir|LINK
Member
30 Points
27 Posts
Re: Crystal Report viewer navigation buttons not working
Jan 23, 2009 02:00 PM|aymanpvt|LINK
did you call report binding inside Not Page.IsPostBack ? like
If Not Page.IsPostBack Then
'call report
End If
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
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.
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
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...
None
0 Points
10 Posts
Re: Crystal Report viewer navigation buttons not working
Jul 29, 2010 05:16 AM|Sandeep_1111|LINK
Thanks guys it solved my problem too.
i also faced the same problem with navigation
Sandeep
Member
2 Points
22 Posts
Re: Crystal Report viewer navigation buttons not working
Sep 13, 2010 04:32 PM|agraspnet|LINK
Hi everybody.
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:
https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe
I hope this can help somebody.
Thanks,
Al
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
Dec 22, 2010 12:24 PM|bali27|LINK
Al,
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
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
Jun 20, 2012 08:15 AM|abdul1585|LINK
Thanks
My Problem Is Solved.................................................Abdul1585
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
May 30, 2013 07:29 AM|ashishshri|LINK
Hi Agraspnet
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.
Thanks
Ashish S
None
0 Points
1 Post
Re: Crystal Report viewer navigation buttons not working
Apr 11, 2014 03:04 AM|Juanan|LINK
Page_Init worked for me. Thanks :-)