How to publish an InfoPath 2007 form to SharePoint 2007

Here I will take an InfoPath 2007 form that I have created in Visual Studio 2008 and publish it to a SharePoint 2007. This is all happening on a virtual machine that I use for development. In this example, I am creating a form that is used to capture minutes and action items in a Board of Directors’ meeting. My InfoPath has code behind to facilitate pushing specific elements of information to other lists in my SharePoint. We also have fields that we want to “property promote” as metadata on the library that will house the populated InfoPath form.  This entry is going to show the steps necessary to publish the form to the SharePoint the first time.

Our first step is to click on Build->Publish in Visual Studio:

ClickPublish

This kicks off a wizard that walks you through the necessary steps to publish this form out. The first frame asks where we want to publish the form. For our purposes, we select the SharePoint server option:

wiz1

The next frame simply requests the url to the SharePoint which we will be using:

wiz2

Next, we tell the wizard that we want this form to be web-enabled. In our case, we want this form to be an administrator-approved form template. This means that your SharePoint administrator will be required to upload this form via Central Administration to make it available to the SharePoint (which we will cover as well).

wiz3

Now, for me, this next step is the not so intuitive part. Because we said we want this to be an Administrator-approved form, we need to save form off to a network location so the Administrator can get to the form when uploading in via Central Administration. So, we must tell it a location to save the form off to:

wiz4

Property promotion. This is where we are telling InfoPath what pieces of data that it holds do we want pushed out to columns in our SharePoint library. It is important to understand this. Any data that you want a workflow to take action on, on any visualization of data that your users will require will need to be pushed out. You can always create a custom web part that actively pulls the data from the submitted InfoPath form, but in most scenarios that is a lot more effort than is really justified. For our example, we want to push out a few fields:

wiz5

Click on Add gives us this dialog:

wiz6

This dialog shows us our data source from our InfoPath form. We will use this interface to at the DateTime and Location data. Selecting these is telling the InfoPath form to take the data in these elements and push it to respective columns in the SharePoint list:

wiz7

Click on Publish and you should see a dialog saying that you have successfully published this form:

wiz8

Now, we need to upload this form via Central Administration. Open Central Administration, select Application Management. Then, under the “InfoPath Forms Services” heading, click on Upload form template:

  wiz9

Using the interface, browse to the form that we just saved and click “Upload”. If all goes well, you will see a message telling you that the upload was successful, like this:

wiz10 

Sometimes, in the message, there will be an instruction to run an stsadmin command to complete the action. When you see that, copy the command. Open an command prompt to run as administrator, navigate to the 12 hive bin and then execute the command. We are almost done. We now need to go into SharePoint and activate the form. We do this by going to the Site Collection Features, find our form (feature) and click on Activate:

wiz11All that is left now is to associate this content type with a library that you want. If you make changes, follow the same steps to re-publish the form, except you will not have to activate, unless you change the properties promoted. If you do that, you will need to deactivate and re-activate the form.

Happy coding!!  Ninja

Advertisements

About lelandholmquest

After serving in the Navy as a Reactor Operator on fast attack submarines, I earned both a Bachelor's and Masters in Information Technology from American InterContinental University and am currently working on my doctorate. I have a beautiful wife and two of the sweetest daughters a man could ask for. And I work for the greatest company: Microsoft. At Microsoft I work on the knowledge management system for Microsoft Services: Campus on Office 365.
This entry was posted in InfoPath 2007. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s