Form View & Printing Help, Please! - InfoPath Dev
in

InfoPath Dev

Form View & Printing Help, Please!

Last post 01-25-2013 05:06 AM by rlwolfgram. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 01-23-2013 04:57 AM

    Form View & Printing Help, Please!

    I am very new to InfoPath. I have InfoPath 2010. I have designed two form views in one file. The first is the form for data entry and the second is the form that needs to be printed, including a page break. The second view should never be seen by the user. I do not want any of the data entered saved in a database -- I just want the user to fill out the form, press the PRINT button, and have the two pages from the print view of the form to print.

    I read a few posts about adding a print button but I could not get the thisXDocument.PrintOut() code to work -- but that would have printed just the form filling view anyway (from what I understand). Please help!

    After the print issue, I'd also like to get a button added to clear the form data. Also is there a way to have the filler program of InfoPath to open without toolbars, etc.?

  • 01-23-2013 05:20 AM In reply to

    Re: Form View & Printing Help, Please!

    I believe you would need to change views, Print, then change views back to the "filling" view.

    To clear the data, you would need to clear the fields one by one... or open a new form, of couse.

    To remove some toolbar options, check in File > Advanced Form Options. You should be able to remove some things there.I don't think you can remove the entire Microsoft Ribbon, though.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-23-2013 06:25 AM In reply to

    Re: Form View & Printing Help, Please!

    Thank you for your very prompt response. I would expect there to be a programming way to get what I need done to be done but my ignorance to InfoPath & programming can be very apparent.

    If I have to do it that way I can BUT when I tried that using the thisXDocument.PrintOut() code in the form, it doesn't work.

  • 01-23-2013 10:58 AM In reply to

    Re: Form View & Printing Help, Please!

    Okay -- so I am an idiot. I can't figure something else out. I created the other view for printing, and I figured out the page break (which was easy so there was no reason I shouldn't have figured that out), but how can I show/print just data from a field and not the field control (like text box, radio button, etc.)?
  • 01-23-2013 11:05 AM In reply to

    Re: Form View & Printing Help, Please!

    Okay - first, you are not an idiot.

    You can use an expression box (calculated value in IP 2010) to display your data without using controls. Just add a calculated value, click the fx box, select the field with the data and you're done. Easy peasy!

    Hilary Stoupa

  • 01-23-2013 11:38 AM In reply to

    Re: Form View & Printing Help, Please!

    Thanks but you're giving me too much credit!

    I follow you and the expression box works but is there a way to put two field's (or more) data in one of those expression boxes so there isn't ackward space? I.E. if you had FirstName and LastName fields, and you wanted LastName, FirstName printed instead of LastName         FirstName

  • 01-23-2013 12:14 PM In reply to

    Re: Form View & Printing Help, Please!

    Sure, use a concat formula: concat(field, ", ", otherfield)
    Hilary Stoupa

  • 01-24-2013 05:53 AM In reply to

    Re: Form View & Printing Help, Please!

    That worked PERFECTLY (not that you expected different results)! Now if I could just get my printing issue figured out.

    I see that If I choose the print option from the menus in the InfoPath header, it prints the pages specified from the "designate print view" selection under the "print settings" of the form's "view properties". But I cannot get the thisXDocument.PrintOut() function to work. I add it to the button but the button does nothing when clicked.

  • 01-24-2013 07:53 AM In reply to

    Re: Form View & Printing Help, Please!

    If you are using IP 2010, I'd expect the code to be:

    this.Print()

    MSDN link. Looks like your form will have to be full trust. Are you sure you need to to this via a button instead of just setting up the print view as a print view for your main view and letting users print via the normal Office route?

    Hilary Stoupa

  • 01-24-2013 11:17 AM In reply to

    Re: Form View & Printing Help, Please!

    That didn't work for me either -- maybe I'm doing something wrong.
    I right-click on the button, choose "button properties", choose "edit form code". A "Visual Studio Tools" window appears with my cursor at the X here:

            Public Sub CTRL57_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
                X ' Write your code here.
            End Sub

    which is where I should type the this.Print() code then save both the visual studio tools and the form itself, right?

  • 01-24-2013 11:38 AM In reply to

    Re: Form View & Printing Help, Please!

    Looks like your form is set to use VB.NET for the language. Me.Print() in that case. Did you check the link I included? It had a VB sample as well.
    Hilary Stoupa

  • 01-24-2013 11:49 AM In reply to

    Re: Form View & Printing Help, Please!

    I COMPLETELY missed there being a link in your post. That worked. What about a "clear fields" function or such? That's the LAST thing I need for this project. I came accross this (http://www.bizsupportonline.net/blog/2009/08/clear-reset-fields-infopath-3-lines-code/) and watched the video but didn't understand it, maybe because it was for InfoPath 2007.

    Thanks again for all your help! I know it can be frustrating when a newbie is trying to do something completely out of their current capabilities...

  • 01-24-2013 12:06 PM In reply to

    Re: Form View & Printing Help, Please!

    How many fields are in your form? It might be easiest to just use rules to clear each field...
    Hilary Stoupa

  • 01-25-2013 05:06 AM In reply to

    Re: Form View & Printing Help, Please!

    That worked! I didn't realize you could get it to change multiple fields.

    Thanks for your help everyone!

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