this.print() and switch view - InfoPath Dev
in

InfoPath Dev

this.print() and switch view

Last post 04-26-2012 11:18 AM by Doreen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-26-2012 11:08 AM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    this.print() and switch view

    In Infopath 2007, I have a print button that should print the view I am on (form code on buttone = this.print()).

    I had set a rule to switch back to another view, assuming it would do so after printing (so user can submit the form to SharePoint) but  the problem is the print button is printing the view I am switching to instead of the view I am on first.  Is there a way to delay the switching to wait for this view to print first?

  • 04-26-2012 11:18 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: this.print() and switch view

    I found this bit of code from microsoft http://msdn.microsoft.com/en-us/library/aa943181.aspx and placed it after this.print() in myInfopath forms button_clicked method:

    this.ViewInfos.SwitchView("View2");

    I have no idea why it is working because I have read that there are problems/error message with the view not printing because it thinks it's switching (it's busy). Knock on wood. 

    Update to my post: the reason error message is when an all code behind solution is used on the button (instead of combined with a rule on button): switch view/print view/switch back....

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.