Using the XmlFormView Web Part with InfoPath Forms
In this earlier post I briefly describe how to embed an InfoPath form in a SharePoint Web Part Page using the XmlFormView web part. I’ve been asked on many occasions to provide a more detailed account.
You can find the step-by-step guide to embedding an InfoPath form in an XmlFormView web part in a white paper at http://www.nickgrattan.net/Publications.aspx. This document also shows how to create a Submit button to override the normal “Save” option on InfoPath forms.
Updated September 2009: Now includes instructions on creating a web part page using Microsoft SharePoint Designer for XmlFormView web parts. This is much easier than using the browser.
Hi…Thanks for the great post!
i have a problem here.. i have a ASPX page that contains XmlFormView Control to render forms that’s already designed using InfoPath.. i can render the form with its toolbars containing Save, Save As, Submit, Close, ……
when i click on save the form is saved in Ms Forms Server, my case is that i want to use another button to do that!!!! i.e i want to add a button on my ASPX page, once clicked, i want the save operation to be done automaticall without clicking on Save button on the form toolbar!! which means that i want to perform saving a form programmatically.
any ideas?? i need help in this.
plz, email me at omomani@esensesoftware.com
OMomani
January 3, 2008 at 2:17 pm
Hi all…
i have a problem here.. i have a ASPX page that contains XmlFormView Control to render forms that’s already designed using InfoPath.. i can render the form with its toolbars containing Save, Save As, Submit, Close, ……
when i click on save the form is saved in Ms Forms Server, my case is that i want to use another button to do that!!!! i.e i want to add a button on my ASPX page, once clicked, i want the save operation to be done automaticall without clicking on Save button on the form toolbar!! which means that i want to perform saving a form programmatically.
any ideas?? i need help in this.
plz, email me at omomani@esensesoftware.com
OMomani
January 3, 2008 at 3:43 pm
Thank you!
The How To is clear and works fine!
Now, my answers are:
Is possible to to the same (Using the XmlFormView Web Part with InfoPath Forms) by using the “New” button of document library?
Is possible to to the same (Using the XmlFormView Web Part with InfoPath Forms) by editng an existing document?
Fabio
January 3, 2008 at 3:59 pm
Thanks very much for the post and the tutorial. Everything worked like a charm. Great solution.
Chris
April 22, 2008 at 1:40 pm
[...] in SharePoint Published July 19, 2007 SharePoint This post has been replaced with this one! This provides a link to a comprehensive document describing this [...]
Embedding InfoPath Forms Service Forms in SharePoint « Nick Grattan’s Techy Blog
May 4, 2008 at 7:33 am
I have the same question as Fabio …
Can you associate this new ASPX page (web part page) with the new button on a forms library list.
Basically I currently have the InfoPath form as a Content Type and that content type is associated to my Forms Library List … works fine. Now I just want to change it to the new ASPX so it can have the same look and feel as the rest of the Sharepoint site.
Help!? Please!?
Aaron
June 5, 2008 at 4:25 pm
I think you’ll find the answer in this blog post – just change the “New Item Form”. Hopefully this will work for you. Nick.
http://nickgrattan.wordpress.com/2008/05/29/chaning-page-used-to-display-items-in-a-list/
Nick Grattan
June 5, 2008 at 4:56 pm
Hi – I am using a xmlformview web part to display an infopath form. all works as expected thanks to your clear directions, however, the theme that i have applied to the site is overridden in this page. how can i fix this?
thanks,
kathy
September 24, 2008 at 5:35 pm
I think you could use code from this page – it might be useful:
http://www.superslimak.pl/zawodowo/art_tech/INFOPATHFORMVIEWER/index.php
MB
September 29, 2008 at 11:03 am
Thanks so much for your step by step guide. It is the best tutorial on the subject I have found. The main advantage for me is that I can now provide site users with a direct link to an infopath form that is open and ready to fill out, eliminating the need to click the New button. I tried to provide the same functionality with a direct link into the form library using the documented query string arguments, but I ran into issues involving url truncation. This seems to work much better.
Joel Daniels
July 10, 2009 at 1:08 pm
Great idea, but will this work over the long run?
Brit-Biering
July 30, 2009 at 12:56 am
XmlFormView is a standard web part provided by Microsoft in Forms Server. All we’re doing here is making it available to SharePoint sites. Therefore, I think this solution is long term viable. Nick
Nick Grattan
July 30, 2009 at 7:22 am
Hi,
How do I change the list so that when I click “new” or try to “edit” an item it opens in a webpart page with the XMLFormView. Right now I’m always being redirected to a infopath page.
Fraser
August 17, 2009 at 10:07 pm
In SharePoint Designer, right-click the list or document library and select “Properties”. Click the “Supporting Files” tab. Make sure the correct content type is selected and change the link for “New”. HTH, Nick.
Nick Grattan
August 18, 2009 at 7:34 am
Not sure how to make sure the correct content type is selected. But I changed both the New and Edit properties but it doesn’t work. As soon as click new, it opens the “_layouts/FormServer.aspx” page and I’m into the InfoPath Browser view. It’s the same for editing an item.
Fraser
August 18, 2009 at 4:53 pm
Your tutorial seem to work for simple form templates containing no VB or C# code. However, if I add programming codes to the form, the template can no longer be uploaded to a document library. Instead, the template must be activated by administrator and use as content type in document libraries.
The XsnLocation used in tutorial is http://moss2007/TestInfoPathTemplate/Forms/template.xsn.
So for a administrator activated template, I tried using http://moss2007/FormServerTemplates/Forms/mytemplate.xsn for XsnLocation. That does not work.
Then I changed XsnLocation back to http://moss2007/TestInfoPathTemplate/Forms/template.xsn and copied mytemplate.xsn from http://moss2007/FormServerTemplates/Forms/ to http://moss2007/TestInfoPathTemplate/Forms/template.xsn. That does not work.
Jason
September 10, 2009 at 10:45 pm
Firstly, thanks for the most required discussion.
I have a problem. I am showing my form in the XMLFormView webpart and saving and submitting to a list at the back end. All seems fine.
Now I have a requirement that if the user fills the form partially and wants to come back to fill the rest. The partially saved form gets saved in the document library and the webpart shows a new instance altogether.
Now how can I open a saved instance of a form in the XMLFormView webpart.
Please help.
Thanks a lot.
Tina
September 30, 2009 at 10:31 pm
Hi Nick
My InfoPath Form contains a Ritch Text Box (RTB) and it is browsable.
If it gets executed and I click into the RTB I get a nice little toolbar displayed (Bold, color, etc.).
But if the same form is hosted by the XmlFormView WebPart, this toolbar is not there anymore. Instead I get a Script error: Object required in my aspx page.
Any ideas how to fix that?
Rene
October 7, 2009 at 10:39 am
Rene, I’ve just tested this with a simple form and it seems to work fine for the simple case. Did you click the “Enable browser-compatible settings only” check box for the “Display” tab in the “Rich Text Box Properties” dialog for the RTB? Nick.
Nick Grattan
October 7, 2009 at 11:58 am
Nick,
Great Tutorial. This is just what I have been looking for. I do have one problem. My aspx documents end up in the “Documents” list and if I open one of them everything looks great! However, after updating the Document Libraries properties on the “Supporting Files” and “Settings” tabs from Sharepoint Designer, my documents are not displayed within SharePoint but loaded into Sharepoint Designer. And that seems to be th case with any .aspx page. Any Ideas?
Jerry Leckness
October 27, 2009 at 2:33 pm
Not sure why you’re changing “Supporting Files” settings on this library. One mistake often made when doing this is to change the settings for the wrong content type. Nick.
Nick Grattan
October 30, 2009 at 7:13 am