Printing with a required field - InfoPath Dev
in

InfoPath Dev

Printing with a required field

Last post 01-20-2011 08:57 AM by witakr. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-09-2009 12:38 PM

    • Mosel
    • Not Ranked
    • Joined on 06-25-2009
    • Posts 12

    Printing with a required field

    Hello All!

    I have deisgned a form with a print view. How does one prevent printing if a required field has not been filled in?

     Thanks!

  • 07-09-2009 05:35 PM In reply to

    Re: Printing with a required field

    Great question and one that I have never ever seen before! :)

    The really simple way to do this is to use a conditional Print View. Define a print view that is wrapped in one big conditional section. If the field is blank, you hide the section and instead display some message like "form is not complete - please make sure all required fields are entered and try again". The user will see that when they print. It's an easy trick which doesn't require a ton of work. In the Designer, go to Design Tasks and click Views. At the bottom of the task pane, choose "Create Print Version for this View". Add an optional section to your data source. Copy all of the controls into it. Double click and add the conditional formatting so that it doesn't show when the form is not filled out.

    To prevent the actual printing will require more work. You'll need to write code to intercept the On Print event and then check the error board and see if any fields are present. I forget whether OnPrint requires Full Trust or not (Tools->Form Options->Security)...

     

    Patrick Halstead
    Project Manager at Qdabra
  • 01-20-2011 08:57 AM In reply to

    Re: Printing with a required field

     I know this thread is a little old but it addresses my exact problem...

     

    I tried looking for what you mentioned Mr. Halstead but I couldn't find it. I am using InfoPath 2010.

     

    I need to prevent printing if the user fails to fill a required field.

     

    Can we revisit this issue with a focus on IP 2010?

     

    Thank for your help!

    Jay

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