Creating a Form Template and Form Library

 < Day Day Up > 

In this section, we will create a simple InfoPath form template that is used to collect data from site safety visits . I will assume that you have Windows SharePoint Services already set up on a Windows 2003 Server machine. If you don't already have both, an evaluation version of Windows Server 2003 can be ordered at http://www.microsoft.com/windowsserver2003/evaluation/trial/default.mspx. Windows SharePoint Services was not included in the initial release of Windows Server 2003. If you need to download Windows SharePoint Services, it was available at the time of this writing at http://www.microsoft.com/downloads/details.aspx?FamilyId=E084D5CB-1161-46F2-A363-8E0C2250D990&displaylang=en.

Creating a Site Safety Form Template

For this example, we will create a simplified form template that can be used as the basis of a safety report by a safety inspector. The form template will be designed using the Data Source Setup Wizard from the XML file shown in Listing 13.1. Use of the Data Source Setup Wizard was demonstrated in Chapter 1, "Getting Started with InfoPath." For this example, select the XML Schema or XML Data File option.

Listing 13.1. A Simplified Safety Report ( SafetyReport.xml )
 <SafetyReport> <InspectorName></InspectorName> <SiteInspected></SiteInspected> <InspectionDate></InspectionDate> <SummaryConclusion></SummaryConclusion> <ActionRecommended></ActionRecommended> </SafetyReport> 

After using the Data Source Setup Wizard, your form template should look like Figure 13.1. It contains the inspector's name, inspection date, site name , summary conclusion, and recommended action.

Figure 13.1. The Data Source after using the Data Source Setup Wizard.

graphics/13fig01.gif

To learn more about using layout tables, see "Creating a View Layout," p. 101 (Chapter 6).


Now follow these steps:

  1. Use a custom layout table with five rows and two columns to create a layout for the labels and the form controls. Drag each field in the data source to the right column of the layout table. Cut and paste the automatically created label into the left column of the layout table. Align the label text to the right of the column, and adjust the column width.

  2. The inspector's name and site name use a text box form control, the inspection date uses a date picker form control, and the summary conclusion and recommended action use a drop-down list box form control. Where necessary, right-click on the default form control and use the Change option to change the form control to the desired type.

  3. Right-click each of the drop-down list form controls, select Properties, and check the Cannot Be Blank check box on the Data tab. Enter the appropriate values manually in the List Box Entries section of the Data tab. For the Summary Conclusion field, enter the values of satisfactory, serious , and minor along with the corresponding labels (see Figure 13.2).

    Figure 13.2. Entering values for the Summary Conclusion drop-down list form control.

    graphics/13fig02.gif

  4. For the Recommended Action drop-down list form control, add the values routine, early , and escalate with the corresponding labels. The form template is shown in preview mode in Figure 13.3 (which includes the labels for the Action Recommended drop-down list form control).

    Figure 13.3. The simplified Safety Report Form Template in preview mode.

    graphics/13fig03.gif

  5. Save (don't publish yet) the form template as SafetyReport.xsn . The form template is included in the download.

Publishing to Windows SharePoint Services

We are now ready to publish the form template SafetyReport.xsn to a Windows SharePoint Services form library. Follow these steps:

  1. Select Publish from the File menu. The Publishing Wizard window opens.

  2. The first screen tells you what the Publishing Wizard does. Click the Next button.

  3. On the next screen of the Publishing Wizard (see Figure 13.4), choose the To a SharePoint Form Library option. Click Next.

    Figure 13.4. Choosing to publish to a SharePoint Form Library.

    graphics/13fig04.gif

  4. On the next screen of the Publishing Wizard, you are offered a choice of publishing to a new form library or modifying an existing library (see Figure 13.5). Select the Create a New Form Library option and click Next.

    Figure 13.5. Choosing to publish to a new form library.

    graphics/13fig05.gif

  5. On the next screen of the Publishing Wizard, enter the URL to which the form template should be published (see Figure 13.6). For convenience, I am publishing to http://localhost/SafetyReport . You will likely have to modify the localhost part of the URL to correspond to your local network configuration. Click Next.

    Figure 13.6. Entering a URL to publish to on SharePoint.

    graphics/13fig06.gif

  6. On the following screen, enter a Name and Description (see Figure 13.7) for the SharePoint form library that is about to be created. Click Next.

    Figure 13.7. Entering a name and description for the form library.

    graphics/13fig07.gif

  7. The next screen offers the option to add columns to the default view of the form library that is about to be created (see Figure 13.8). Add a column for each field in the InfoPath form template's data source that you want to display in the default (SharePoint) view of the form library. Click the Add button. The Select a Field or Group window opens (see Figure 13.9).

    Figure 13.8. Adding columns to the form library.

    graphics/13fig08.gif

    Figure 13.9. Selecting a field or group to promote to a form library column.

    graphics/13fig09.gif

  8. Click on the InspectorName field to select it. Insert a space in the Column name text box to produce a plain English label. Unfortunately, InfoPath doesn't automatically create nicely formatted labels here. Click OK.

  9. Do the same for each of the other fields in the InfoPath data source, and edit the text in the Column Name text box appropriately. When you have completed the process, the Publishing Wizard should look like Figure 13.10. Click the Finish button.

    Figure 13.10. Columns added to the form library.

    graphics/13fig10.gif

  10. If the form template has been published successfully, you will see the screen shown in Figure 13.11. Check the Open This Form From Its Published Location check box, and then click the Close button.

    Figure 13.11. Successful publishing of the form template to the form library.

    graphics/13fig11.gif

If all has gone well, an Internet Explorer window displaying the newly created Safety Report form library will open (see Figure 13.12). The appearance on your Windows SharePoint Services installation may differ , depending on the style you have chosen for the site to which you've added the form library.

Figure 13.12. The Safety Report form library.

graphics/13fig12.gif

The form library has just been created, so it has no data. To open InfoPath so you can add data to the Safety Report form library, click Fill Out This Form. InfoPath opens with the safety report ready for you to enter data.

Figure 13.13 shows the form with some sample data. We are now ready to submit the data to the Safety Report form library, but we haven't added a submit button. Note that when using InfoPath to contribute data to a SharePoint Form Library, the term save is used, but with a different meaning from when we save a form template in design mode. Follow these steps:

  1. Select Save from the File menu (or use the Ctrl+S keyboard shortcut). The Save As window opens (see Figure 13.14). Notice that the name of the form library and the name of the server are displayed in the drop-down menu at the top of the Save As window. Note, too, that a view of the form library is displayed in the main part of the Save As window.

    Figure 13.14. Saving to a SharePoint site on localhost.

    graphics/13fig14.gif

  2. Select a name for the form to be saved. I chose form1.xml . Remember that it is the XML file that is saved to the SharePoint form library using this technique, not the form template (we published the form template to the form library a little earlier). Click OK.

  3. After refreshing the browser window, you should see an appearance similar to Figure 13.15. Notice that columns we added and named using the Publishing Wizard have been added to the form library.

    Figure 13.15. A form has been added to the form library.

    graphics/13fig15.gif

  4. Using the Fill Out This Form button, open, fill in, and save several more forms (see Figure 13.16). We will use this data to demonstrate filtering in a form library a little later in this chapter.

    Figure 13.16. Several forms added to the form library.

    graphics/13fig16.gif

Figure 13.13. The form with sample data.

graphics/13fig13.gif

To focus on selected data submitted from our simplified form template, we will need to create a new SharePoint view.

Creating a New SharePoint View

In production form templates, you can expect to submit much larger amounts of data to a form library than we have from our simplified example. To allow team members to focus on relevant data, you can create new SharePoint views. Follow these steps:

  1. With the form library open, click on Documents and Lists near the top of the form library window. A page similar to Figure 13.17 opens. (Depending on whether your Windows SharePoint Site is for production or test purposes, you might see many more form libraries listed than in Figure 13.17.)

    Figure 13.17. Documents and lists on the SharePoint virtual server.

    graphics/13fig17.jpg

  2. Click on Safety Report. A window similar to Figure 13.18 opens.

    Figure 13.18. Select Modify Settings and Columns in the form library window.

    graphics/13fig18.jpg

  3. Click on Modify Settings and Columns. The Customize window opens.

  4. Scroll down to the Views section of the Customize window and click Create a New View (see Figure 13.19). The Create View window opens (see Figure 13.20).

    Figure 13.19. The Customize window.

    graphics/13fig19.gif

    Figure 13.20. The Create View window.

    graphics/13fig20.gif

  5. Select Standard View from the Create View window. The Create (Standard) View window opens (see Figure 13.21).

    Figure 13.21. The Create (Standard) View window.

    graphics/13fig21.gif

  6. Call the view Custom Report. In the Name section, enter the desired name in the View Name text box. Check the Make This the Default View check box.

  7. In the Audience section, leave the Make This a Public View option button selected. Scroll down to the Columns section of the Web page (see Figure 13.22), where you can specify which columns should be visible and the order in which they should appear.

    Figure 13.22. The Columns section of the Create (Standard) View window.

    graphics/13fig22.gif

  8. We will display only the five columns corresponding to the five fields in the data source of the SafetyReport.xsn form template. Figure 13.23 shows the Columns section after selecting the desired columns. Be careful to avoid scrolling a wheeled mouse while a position drop-down is highlighted, or you could find that columns have been unintentionally reordered.

    Figure 13.23. The columns selected and ordered.

    graphics/13fig23.gif

  9. Scroll down. We will not use the Sort, Filter, Group By, Totals, Style, Folders, and Item Limit sections of the window. Click the OK button at the bottom of the page.

  10. The Customize Safety Report window opens. Above the General Settings section, click Go Back to "Safety Report" (see Figure 13.24). The Safety Report form library opens.

    Figure 13.24. Select the Go Back to "Safety Report" option.

    graphics/13fig24.gif

  11. As you can see in Figure 13.25, the columns we selected when constructing the new view are displayed. Notice too, in the left column of the screen that Custom Report is highlighted (we made the Custom Report view the default when we created the view).

    Figure 13.25. The newly created Custom Report view of the Safety Report form library.

    graphics/13fig25.gif

In a production setting, you would likely want to filter data in a form library for many purposes.

Filtering Form Library Data

After you add significant amounts of data to a form library, it can be difficult to visually identify data of interest. Windows SharePoint Services provides filters to be used in form libraries so that only desired information in a view is displayed.

Click Filter in the Custom Report view. The drop-down menus that allow you to filter data are displayed for each visible column in the SharePoint view (see Figure 13.26). Each drop-down menu displays the default value (all).

Figure 13.26. The Filter drop-down menus for the Custom Report view.

graphics/13fig26.gif

Filters allow you to display selected information flexibly and powerfully. In this example, we will display only forms where the value in the Action Recommended column is escalate (see Figure 13.27).

Figure 13.27. Filtering the Action Recommended column of the Custom Report view.

graphics/13fig27.gif

As you can see in Figure 13.28, only forms that have the value escalate in the Action Recommended form are now displayed.

Figure 13.28. The Custom Report view filtered for escalate values in the Action Recommended column.

graphics/13fig28.gif

Depending on the sample data that you saved in your form library, you can experiment with various combinations of filters on different columns.

Windows SharePoint Services has much more functionality than can be demonstrated in this chapter. However, this discussion has given you a flavor of what is possible.

 < Day Day Up > 


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net