Hello. I'm having a problem with my report concerning the CreateDocument() command. My code is as follows:
private void lbShowHide_PreviewClick(object sender, PreviewMouseEventArgs e) { // Obtain the category's ID stored in the label's Tag property. int index = (int)e.Brick.Value; // Determine whether the current category's details are shown. bool showDetail = ShouldShowDetail(index); // Toggle the visibility of the category's details. if (showDetail) { expandedValues.Remove(index); this.DetailReport1.Visible = true; this.DetailReport.Visible = false; this.GroupHeader2.Visible = true; this.GroupHeader1.Visible = false; } else { expandedValues.Add(index); this.DetailReport.Visible = true; this.DetailReport1.Visible = false; this.GroupHeader1.Visible = true; this.GroupHeader2.Visible = false; } // Re-create a document to apply the changes. CreateDocument(); }
If the user was on page 2 and they toggled the show/hide, the CreateDocument() re-creates the document with the changes but it starts back on page 1. Is there a way to come back to the page that the click event took place (In this case page 2)?