Thursday, January 14, 2010

Forcing InfoPath form links to load in web browser

by: dougthebuilde (formerly bobthebuilder)

REF: http://suguk.org/blogs/sharepointhack/archive/2007/05/06/3281.aspx

Scenario and solution:
You have a page that containd web part views into your forms library (that contains forms that can be filled out in a browser). The problem here is that if you or your client has InfoPath installed on their computer, everytime they click the link the form will try and open in their InfoPath client; prompting them for authentication.

If the client goes to the forms library itself and clicks on a InfoPath form the form opens in the browser no problem, why? The answer is in the url, try this:

Now, to fix the URL in the web part we are going to need to convert that web part to a data view web part through sharepoint designer:

  • Open one of your forms from the form library and copy the URL into NotePad.
  • Open the offending page containing the web part in sharepoint designer.
  • Go to design view, right click the web part and select convert to xslt data view.
  • Select the ">" next to the data field that you want displayed as the link to the file and then select the option to format the text as a hyperlink.
  • In the new dialog box, in the location text box paste the URL from NotePad.
  • Replace the following text: "XmlLocation=/subsite/formLibrary/formName.xml" in the location text box with "mailto:XmlLocation=%7B@FileRef%7D" this tag indicated the full URL to the form.
  • Save

Open the web part page and click the link in the web part: the form now opens in a web browser!

No comments:

Post a Comment