I found I needed to know the current page number on postback so I can restore the report to that page on a refresh. To get the page number, I added a handler to the CR Viewer’s Navigate event on the code behind to store the current page number (see code below). The issue I found is that the body.onunload event is now getting triggered. This is an issue because I keep the ReportDocument in session and remove it through in a web method call from the body.onunload. So now after adding the handler, my program unloads the document and has to reload it including pulling the data again from the db every time I press a navigate button. If I don’t have the handler on the page, the body.onunload doesn’t get triggered when I press the navigate buttons.
Protected Sub CRVs_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles CRV.Navigate
Session(“ReportViewer_PageNumber”) = e.NewPageNumber
End Sub
Is there another way to get the page number without using this event?