none
C# Starting on a certain page when using CreateDocument () RRS feed

  • Question

  • 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)?

    Wednesday, March 13, 2013 8:48 PM

All replies

  • Hi r2k3982,

    From your description, I think this is not a WPF special question and I will move it to C# General Forum for better support.

    In addition, could you please provide the definition of CreateDocument()?

    Thanks,

    Lisa Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 11:20 AM
    Moderator
  • Hi,

    Welcome to MSDN forum.

    As Lisa suggested, could you please provide more information about CreateDocument?   What kind of reporting are you using?

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 2:41 PM
    Moderator