In the previous blog post, a technique was described for embedding a browser-enabled InfoPath form in a SharePoint web part page. This was done using a standard XML Form View web part and allows the navigation context of the page to be retained. The only disadvantage of using this technique is that it is not possible to close the InfoPath form and return to the original Document Library, as would be the case with a normal document library or SharePoint list.
The InfoPath forms server displays a simple message that the form has been closed, as follows:
If this behavior poses a problem to users, then an alternative XML web part is available, which allows for additional URL strings to be passed containing the address of the page which should be returned to after the InfoPath form has been saved.
Ensure that the InfoPathFormViewer web part is available in the Site Collection Web Part Gallery and insert into a basic web part page.
Set the parameters under the Miscellaneous section as follows:
<div class=”EForms”> <div class=”EForms2″> <div class=”EForms3″> <div style =”text-align:center;margin-top:10px;”> <iframe src=”%formurl%” width=99% scrolling=no frameborder=0 marginwidth=0 marginheight=0 height=600 >info path here</iframe> </div> </div> </div> </div>
Note that to return to a specific page, it is necessary to add a Source URL parameter, alongside the Xsn and Save Locations.
This code should be entered in a Content Editor web part positioned in the All Items view page before any other web parts.
Leave a Reply