Deploying Infopath forms

Published 28 March 08 03:04 PM | Tom Wardill

Sometimes you need to deploy infopath forms to use in a form library.
The main way to do this appears to be to install Infopath onto the server and use the publish wizard. This naturally isn't all that acceptable, as it uses office licenses, and generally isn't best practice.

After some hunting around, cab file modifying and an epiphany moment, I've found a better way (which turns out to be quite obvious....)

On the development machine

  1. Run the publish wizard.
  2. Select the first option "To a Sharepoint server with...."
  3. Enter the url of your development sharepoint environment
  4. Tick the "Enable this form to be filled out by using a browser"
  5. Select "Administrator-approved form template (advanced)"
  6. Give it a save location and filename
  7. The next screen will then let you select the fields and columns you want to appear in the form library, exactly as if you were publishing the form directly to the server.
  8. Publish the form.

This will then generate a .xsn that will be saved where you told it to.

On the server

  1. Copy the .xsn to the server.
  2. Run these commands:
    1. stsadm -o verifyformtemplate -filename <filename>
    2. stsadm -o uploadformtemplate -filename <filename>
    3. stsadm -o activateformtemplate -filename <filename> -url <sharepointurl>
  3. This should then activate the form, which can then be used as a content type for a form library.

The epiphany moment

The .xsn is just a cab file renamed. This means that it also includes the code behind dll and everything that is required for the form to deploy, so you don't have to worry about copying the DLL to anywhere or anything like that.
This makes deployment a lot easier.

 

Enjoy

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)