Form View & Printing Help, Please! - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Form View & Printing Help, Please! 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: Oldest to newest Newest to oldest Previous Next 01-23-2013 04:57 AM rlwolfgram Joined on 01-23-2013 Posts 8 Form View & Printing Help, Please! Reply Contact 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 ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 01-23-2013 06:25 AM In reply to rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact Sure, use a concat formula: concat(field, ", ", otherfield) Hilary Stoupa 01-24-2013 05:53 AM In reply to rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 Subwhich 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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 rlwolfgram Joined on 01-23-2013 Posts 8 Re: Form View & Printing Help, Please! Mark as Not AnswerMark as Answer... Reply Contact 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.
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.?
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.
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.
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!
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
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.
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?
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?
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...
That worked! I didn't realize you could get it to change multiple fields.
Thanks for your help everyone!