|
At the time you're creating the SharePoint data connection, it's likely that
a SharePoint Services site already exists. However, it's also likely that the
library hosting the form template doesn't. When using the InfoPath Data Connection
Wizard, you'll need to record the form library URL that you specify, as it will
be used later when publishing the form template. The following steps show how
to create a SharePoint data connection in InfoPath 2003 SP2 for our Status Report
sample:
- Click Tools, Data Connections.
- In the Data Connections dialog box, click Add, which opens the Data Connection
Wizard.
- On the wizard's first screen, click Submit data and click Next.
- Select To a SharePoint form library and click Next.
- In the SharePoint form library box, type the URL for the form library that
will host the form template. In our example, we'll be creating a Status Report
form library on our SharePoint Services Reports site, so we'll use this URL:
http://server2003ee/sites/reports/status.
In addition to the form library URL, you must specify a naming convention for
submitted form files. It usually makes sense to use form field values in file
names to help ensure uniqueness in your naming convention. The concat function
lets you combine two or more field values for specifying file-names. Continuing
in the Data Connection Wizard, you'll perform the following steps to use the
Status Report's Name and Date fields for a filenaming convention:
- Click the function (fx) button, located to the right of the File
name box.
- In the Insert Formula dialog box, click Insert Function.
- In the Insert Function dialog box, double-click the concat function.
- In the Insert Formula dialog box, in the Formula box, double-click the
first prompt within the concat function (e.g., double click to insert field),
as Figure 4 shows.
- In the Select a Field or Group dialog box, expand the Employee group,
then the Name group, and double-click singleName.
- In the Insert Formula dialog box, in the Formula box, double-click the
next prompt within the concat function.
- In the Select a Field or Group dialog box, double-click date.
- In the Insert Formula dialog box, in the Formula box, delete the comma
after date and delete the third prompt within the concat function, which Figure
5 shows
- Click OK.
- In the Data Connection Wizard, select the Allow overwrite if file exists
check box.
- Click Next, then click Finish.
- In the Data Connections dialog box, click Close.
User Submit options
By default, submit options aren't enabled in your form template, even when you've
defined a submit data connection. However, it's relatively simple to enable
submit commands on the InfoPath toolbar. You can also easily define InfoPath's
behavior when submitting forms (e.g., closing the form template after a submit
operation is complete). To enable submit options for our Status Report example,
perform these steps:
- Click Tools, Submitting Forms.
- In the Submitting Forms dialog box, click Enable Submit commands and
buttons, as Figure 6 shows.
- In the Submit to drop-down list, select SharePoint form library.
- Click Submit Options.
- In the Submit Options dialog box, click Close the form and click
OK.
- In the Submitting Forms dialog box, click OK.
Promoting Column Names
Before you publish the template, you can define column names for the SharePoint
form library to which the template will be published. These column names are
based on elements in the form template, and you can change the names as needed.
This promotion offers SharePoint users read access to some of the data in the
corresponding form files, without requiring InfoPath 2003 SP2 to be installed.
The Status Report sample defines five column names for its form data. In the
following example, we remove two of those columns and add one for the submitter's
email address:
- Click Tools, Form Options.
- In the Form Options dialog box, click the Form Library Columns tab.
- Click Manager Name and click Remove.
- Click Department and click Remove.
- Click Add.
- In the Select a Field or Group dialog box, expand the employee group and
click emailAddressPrimary.
- In the Column name box, type E-mail and click OK.
- In the Form Options dialog box, click OK. Figure
7 shows an example of the promoted columns
Deploying the Form Template
After you identify the SharePoint column names, you can now use the InfoPath
Publishing Wizard to deploy the form template. The following steps show how
to create a new Status Report form library on your SharePoint Services Reports
site:
- Click File, Publish, to open the InfoPath Publishing Wizard.
- In the first screen, click Next.
- Select To a SharePoint form library and click Next.
- Click Create a new form library (recommended) and click Next.
- In the Enter the location of your SharePoint site field, type the
URL you entered when creating the SharePoint data connection (e.g., http://server2003ee/
sites/reports) and click Next.
- Type status in the Name box and type a description in the Description box,
as Figure 8 shows.
- Click Next. Click Finish, then click Close.


|