I've created a report which currently has 5 pages. I'm loading it into a CrystalReportViewer in Visual Studio 2005 (see code below). When I run it though the next & previous buttons don't work correctly. It goes to page 2 ok but after that it wont move to page 3. I can type in the page number and it will go to the right page. If I'm on the last page and select the previous button it goes all the way back to page 1. When I run the report inside Visual Studio 2005 next and previous buttons work fine. Any ideas?
public partial class _Default : System.Web.UI.Page {
private ListBox listBox;
protected void Page_Load(object sender, EventArgs e){
if (PreviousPage != null) {
ListBox listBox = (ListBox)PreviousPage.FindControl("ListBox1");
if (listBox != null) {
this.listBox = listBox;
Session["report"] = this.listBox.SelectedValue;
}
}
CrystalReportViewer1.ReportSource = (String)Session["report"];
}