Switching Views without Code - InfoPath Dev
in

InfoPath Dev

Switching Views without Code

Last post 07-08-2012 02:14 PM by aberya. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-05-2012 02:21 PM

    Switching Views without Code

    Hi there

     Just wondering if anyone knows if it is possible to write an expression or formula to detect the current view of an InfoPath form, without running code behind?

    I have built an infopath form that has three views, Writable, Read Only and Print Views.  In the form is a Read Only flag in the schema and we use this control if the form is Read Only or Writeable.  We have added a Rule when the form is opened to switch the view to the ReadOnly view when ever the Read Only flag is set.  However this has the side effect that when the Print Preview button is clicked in Form Services the Form Load rules execute and if the Read Only flag is set it displays the Read Only view, not the Print View. 

    The form load rule is basically "If ReadOnly = 1 then Switch View to ReadOnly" so I think I need to get rid of that rule or be able to detect that the form is trying to print.

    Does anyone have any suggestions on how to resolve this issue?

    Cheers

    Alan

  • 07-06-2012 03:22 PM In reply to

    Re: Switching Views without Code

    Well, to directly answer your first question - no, you need code to know what view the form is on.

    I am puzzled by the print preview behavior you are describing - opening print preview is re-executing your form load rules? Or is it that the Read Only view doesn't have a print view? Or perhaps something else is preventing the print view from opening?

    Hilary Stoupa

  • 07-08-2012 02:14 PM In reply to

    Re: Switching Views without Code

    Yes you were right, we discovered that the read only view didn't have a print view set.

    Thanks for your help.

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