Deploying InfoPath Form Templates to a SharePoint Library

In previous versions, InfoPath integrated with Windows SharePoint Services through a form library. This library contained a single InfoPath form template on which new forms could be created and stored in the library. The form library still exists in Windows SharePoint Services 3.0, but the standard document library can also be used to deploy form templates and store forms based on that template. Document libraries also support multiple "content types" which are used to support multiple form templates in a single document library. Additionally, forms based on any form template in that document library are, by default, stored in the document library.

Microsoft Office SharePoint Server 2007 and InfoPath Forms Services are both built on the SharePoint platform and enable form template designers to publish a form template to a server. Users can create new forms based on that form template using a Web browser without requiring Microsoft Office InfoPath 2007 installed on the client computer. A browser-compatible form template is a form template that is compatible with a server running Office SharePoint Server or InfoPath Forms Services. A browser-enabled form template is a form template that has been published or Administrator-approved to run on a server running Office SharePoint Server or InfoPath Forms Services. Form templates that contain custom code require server Administrator approval.

Deploying a form template to a document library

There are three types of SharePoint deployment options available to InfoPath form template designers:

  • Backward compatible form templates in a form library.
  • Browser-compatible form templates that do not contain custom code.
  • Browser-compatible form templates that contain custom code.

Backward compatible form templates in a form library

Requirements: Windows SharePoint Services 2.0, Windows SharePoint Services 3.0, or Microsoft Office SharePoint Server 2007

The process of deploying a form template to a SharePoint form library is the same for all versions listed above. To learn more about deploying to a SharePoint form library, search InfoPath Help in the design UI for deploying form templates to a SharePoint library. In addition, see Deploy a Fully Trusted Form to a SharePoint Form Library in the InfoPath Developer Reference.

Browser-compatible form templates without code

Requirements: Microsoft Office SharePoint Server 2007 or InfoPath Forms Services

The browser-compatible form template, when published to a SharePoint library, is converted into a ASP.NET application that runs on the server. Office SharePoint Server or InfoPath Forms Services is required on the server to convert the form template into an ASP.NET application, and for the application to function like a form template when the form is filled out.

Browser-enabled form templates that do not contain code can, by default, be published to a SharePoint library. However, this capability is controlled by an administrative setting on the server. If you cannot publish a browser-compatible form template to a SharePoint document library, contact the server Administrator.

Creating a browser-compatible form template

The compatibility setting of a form template can be InfoPath, in which case it will only work in the InfoPath client, or InfoPath and InfoPath Forms Services. This compatiblity setting is made when designing the form template, but can be changed at any point during form template design. To check the compatiblity settings of a form template, use the following steps:

  1. On the Tools menu, click Form Options.
  2. Select the Compatibility category.
  3. To make a form template browser-compatible, select the appropriate setting in the Browser compatibility section of the dialog box.
  4. Click OK.

You can click Change compatibility settings on the Design Checker task pane to go directly to this category in the Form Options dialog box. The Design Checker task pane and the status bar indicate the form template's current compatiblity setting. For more information about using this task pane, click Help with Design Checker at the bottom of the task pane.

Publishing a browser-compatible form template

Publishing a browser-compatible form template that does not contain code creates a browser-enabled form template. The form template compatibility setting must be InfoPath and InfoPath Forms Services before it can be published. To publish a browser-compatible form template to a SharePoint library, follow these steps:

  1. On the File menu, click Publish.
  2. Select To a SharePoint server with or without InfoPath Forms Services and click Next.
  3. Type the URL location of a server running Office SharePoint Server or InfoPath Forms Services and click Next.
  4. Select Document Library and click Next.
  5. Select Create a new document library and click Next.
  6. Enter a name and optional description for the new document library and click Next.
  7. Select fields from the form template that you wish to display as columns in the document library and click Next.
  8. Click Publish.
  9. Once the form template is published, you can choose to e-mail the location of the form template or open the library in the default Web browser by checking the appropriate boxes.
  10. Click Close.

By default, when you create a new form in a SharePoint library containing a form template, the form will open in InfoPath if Office InfoPath 2007 is installed on the computer. To see what the browser-enabled form template looks like in the Web browser, follows these steps:

  1. In the newly-created document library, choose Form Library Settings from the Settings menu.
  2. In the General Settings section, click Advanced settings.
  3. Click Display as a Web page in the Browser-enabled Documents section of the Form Library Advanced Settings page.
  4. Click OK.
  5. Click the link near the top of the page to return to the document library.
  6. Click New to open the form in the Web browser.
Bb250997.vs_note(en-us,office.12).gif  Note
Change this setting back to Open in the client application if you prefer users to fill out the form in InfoPath when it is available on the client computer. If Office InfoPath 2007 is not available, users will be able to fill out the browser-enabled version of the form template in a Web browser.

Browser-compatible form templates with code

Requirements: Microsoft Office SharePoint Server 2007 or InfoPath Forms Services

Browser-compatible form templates that contain custom code cannot be directly published to a server running Office SharePoint Server or InfoPath Forms Services. For many reasons, including server managability, security, and performance, a form template that contains custom code requires Administrator approval before it can be associated with a document library or generally available as a Web application. An Administrator-approved form template is not browser-enabled until after the form template is published and the Administrator has approved the form template for use on the server.

Follow the steps for publishing a browser-compatible form template without code in the previous section, but instead of clicking Document library in step 6, click Form Template for Administrator-approval (advanced). Continue through the Publishing Wizard and when finished, e-mail the form template to the server Administrator for approval. For more information about approving browser-compatible form templates with code, see Deploy administrator-approved form templates.

A Note about Custom Code in Browser-enabled form templates

A form template containing custom code can be browser-enabled only if the code is written in Visual Basic or C# and it uses a subset of the classes and associated members of the Microsoft.Office.InfoPath namespace. Backward compatible form templates containing JScript or VBScript, or those containing custom Visual Basic or C# code using the classes and members of the Microsoft.Office.Interop.InfoPath.SemiTrust namespace, cannot be browser-enabled. For more information about developing with managed code, see the InfoPath documentation installed with the Microsoft Visual Studio 2005 Tools for Applications (VSTA) programming environment. For an overview of the programming options available in Office InfoPath 2007, see About InfoPath programming environments.