MS InfoPath


Another favorite application is MS InfoPath, which was released for the first time in October 2003, along with MS Office 2003. It still looks very much the same in its new version, InfoPath 2007, but under the hood several important things has changed. The main purpose of this application is to create electronic forms, such as expense reports, time cards, vacation forms, and so on. One important new feature in InfoPath 2007 is its ability to create web forms that can be used by SharePoint 2007 and Office 2007; for example, workflow forms and the Document Information Panel displayed by Office 2007 applications, such as Word and Excel 2007. Another very important difference is that SharePoint 2007 can display InfoPath forms as HTML web forms, thus removing the requirement that a user who wants to fill in a form must have MS InfoPath locally installed. This was probably one of the main reasons that InfoPath 2003 was not implemented by customers, although it was great product.

Building InfoPath Forms

An important characteristic of MS InfoPath is its file format: it is completely based on the Extensible Markup Language (XML) standard, which makes the form and its content readable by other applications. SharePoint is one such application. When you save an InfoPath file in a SharePoint library some, or possibly all, of its content will be displayed as columns, so you do not need to open the form to see what's in it. For example, say that you have a time card form that employees use to enter their weekly working hours. Instead of opening each form file to see its content, some of its content is now displayed automatically as columns (see Figure 7-25).

image from book
Figure 7-25

To make this happen, the designer of the InfoPath form must publish the form to SharePoint in a special type of library, called a Forms Library, that stores XML-based documents. When publishing the form, the designer will also decide what information from the form that will be displayed as a column in the library. The beauty of having content displayed as columns is that you can create views for the library, which organize the information in many ways. For example, say that the manager for a team wants to see the time cards organized per employee, while the people in the human resources department want to see them organized by week. And while you are at it, why not make the view summarize the working hours. This way, there is no need to copy these figures to an Excel spreadsheet and create a report from that. The next figure, Figure 7-26, shows you such a view calculating the total hours per week. For example, you can see that for the week of 11/2/2006 there are two time cards and that the total hours for this week is 112, the total regular hours are 78, and total overtime hours are 34.

image from book
Figure 7-26

To create an InfoPath form, you need the MS InfoPath rich client; you cannot design a form using the web client. You can start from an empty form and add the field controls you need. Or, you can start from a form template that is similar to what you want to do and then customize that template. Let's do another example. Your boss tells you that she needs a very basic form where employees can enter their vacation periods. She also says that she will need a report that shows when employees will be away from the office. Oh, and she wants this by the end of this day. So what do you do? The steps listed in the Try It Out below illustrate one way of doing this.

Try It Out Create a InfoPath Form

image from book
  1. Log on with a user account that has permission to create libraries in the site where you want to store the forms.

  2. Start InfoPath 2007. It will start by displaying a dialog window named Getting Started. See Figure 7-27. Here, you have several options: you can open an existing form (click the existing form name under Open a form), you can start a form from scratch (Click Design a Form Template), or you can start from a template (click Customize a Sample and select any of the samples in the center pane, or click Form Templates on Office Online, which will display a large number of publically available form templates stored at Microsoft's web site). In this example you will create this form from scratch, so click Design a Form Template, then select Blank and click OK.

    image from book
    Figure 7-27

  3. An empty form window is displayed; at the right you have a Task Pane, displaying Design Tasks. The links in this pane allow you to do a number of things:

    • q Layout: Use this link to create tables and regions in the form, which you will use later for storing controls (see below).

    • q Controls: This is a toolbox with many different types of controls, such as simple text fields, date fields, and numeric fields, but also more advanced controls for uploading documents to the form, displaying a picture, and creating a hyperlink.

    • q Data Source: This is a list of all the data sources for the form, including its field controls. Use this view to quickly get a list of all the data fields and sources.

    • q Views: Use this link when you need to create more than one view of a form. For example, the users who fill in the form will see a limited part of the form, whereas the user who manages this form will see everything.

    • q Design Checker: Click this link to run a test of your form. If there is any problem, the design checker will tell you what it is.

    • q Publish Form Template: This will start the wizard that will help you publish the form, for example, to a SharePoint library.

  4. Your vacation form should contain the following types of information: the name of the employee, the start date for the vacation, and the end date, (yes, it's a very simple form). You already have the empty form, so let's start the design:

    1. Click Table with Title in the Task Pane, and a headline table will be displayed on the form. Click where it says Click to add a title, and enter the text Vacation Request. Then click where it says Click to add form content and enter the text Enter the dates for your vacation. By now you should have a nice headline in your form.

    2. The next step is to create the table where you will store your text and date controls. Note that this step is just here because it will be easier to get a nice layout. If you want, you can add controls to any part of the form page, not just to a table! First, click anywhere under the headline table to place the cursor there. Press the Enter key once, to get a new line. Now click Three Column Table in the Task Pane. A one-row table with three columns is displayed on the form. Right-click in the first column, then select Table Properties. Switch to the Row tab, and select Automatically set row height, then click OK.

    3. Click in the first column: Enter the text Name. In the second column, enter Start Date, and in the third column, enter End Date. Then press the Tab key, and a new row will be created.

    4. It is time to add the field controls. On the Task Pane, click the black arrow to display its menu, then select Controls. Place the cursor in the first column of the second row. Then click on the control Text Box in the Task Pane. Place the cursor in the second column and click Date Picker, then place the cursor in the third column and click the Date Picker again.

    5. To make it easier for you later to understand what controls do, give them a descriptive name: Right-click on the text control (second row, first column), then select Text Box Properties, and change the Field name to User_name. Repeat this for the other two controls, and name them Start_Date and End_Date, respectively.

  5. The form is now complete. The next step is to save it: Click File image from book Save, and click OK if you get a dialog box telling you that you must publish this form before it can be used by others. Enter a folder location, and a name, for example Vacation Request, and click Save.

  6. It's time to publish this form to a SharePoint library. Before you do this, you should think about where to create this new library. In this example, you will save it in a library named Vacations, stored in the site http://srv1/sitedirectory/sis.

    1. Click on the menu File image from book Publish, and a dialog box will be displayed (see Figure 7-28).

      image from book
      Figure 7-28

    2. Make sure that the option To a SharePoint server with or without InfoPath Forms Services is selected, then click Next.

    3. Enter the URL to the SharePoint site where the new library will be created, http://srv1/sitedirectory/sis, and click Next.

    4. A new dialog box is displayed. Select Document Library and click Next.

    5. Make sure that the option Create a new document library is selected, and click Next.

    6. Next you will enter a name for this new library; in this example, it is called Vacations. You can also enter a description. When you're ready, click Next.

    7. The next page is where you define what form content you want displayed as library controls. Click Add, select User_Name, and click OK. Then add Start_Date and End_Date in the same way. You should now see three column names listed. Click Next to continue.

    8. You are now almost finished. Click Publish to create the library, and associate the new form with it. The final page in this Publishing Wizard gives you an option to send an e-mail to users you want to have a direct link to this library. You can also choose to open the library directly. Check this last option, and click Close. The new library is displayed.

  7. Finally, let's test the new form. Click New, and InfoPath will open the form (see Figure 7-29). Enter a name, plus select a start and end date, then save the form as Form1, and close InfoPath. The new file is now listed in the library, and the columns display the values you set in the form.

image from book
Figure 7-29

image from book

Displaying the Form Content

Let's have some fun: Add three more vacation forms to the library, for three other users, but with vacation dates near the first one. You can now test another type of view that is interesting for this type of information, based on dates. The boss, in this example above, wanted a report that showed her when employees have requested vacations. This is easily done by creating a graphical view of the list, based on a Calendar view, or a Gantt schema. Follow the steps in the Try It Out below to create the Calendar view.

Try It Out Present Forms Data in a Calendar View

image from book
  1. Open the Vacation library (make sure to log on as a user with permission to create views).

  2. Click View: All Documents in the upper right, to display the View menu.

  3. Select Create View. On the next page, Choose a view format, select Calendar View.

  4. On the Create Calendar View: Vacations page, you will define the new view by entering these values (accept the other default values):

    1. Name: Enter a name for the view; for example, Calendar Overview.

    2. Begin: Use the menu and select Start Date.

    3. End: Select End Date from the menu.

    4. Month View Title: Select User Name from the menu.

    5. Weekly View Title: Select User Name.

    6. Daily View Title: Select User Name.

    7. Then click OK to save and close the new View.

  5. The new weekly view should be displayed, and it should look similar to Figure 7-30.

image from book
Figure 7-30

image from book

Another way to present this vacation form data is to use a Gantt schema, which normally is used to present project activities, but is also excellent for this task, since it gives a better overview than the Calendar view:

Try It Out Present Forms Data in a Gantt View

image from book
  1. Open the Vacation library.

  2. Click View: All Documents in the upper right, to display the View menu.

  3. Select Create View. On the next page: Choose a view format, select Gantt View.

  4. On the Create View: Vacations page, enter these values (accept the other default values):

    1. Name: Enter the name Gantt Overview.

    2. Title: Use the menu and select User Name.

    3. Start Date: Select Start Date from the menu.

    4. Due Date: Select End Date from the menu.

    5. Click OK.

  5. The same form data as used before is now presented in a Gantt view. It is clearly a better view, and I think your boss will be happy with this. (See Figure 7-31).

image from book
Figure 7-31

image from book

The Office Forms Service 2007

If you want to display the form as an HTML web form, you must also have the Office Forms Service 2007, which comes with MOSS 2007 Enterprise Edition. This module can also be purchased separately as an add-on to the MOSS 2007 Standard Edition. This forms service will convert an InfoPath form into HTML, when requested to do so. The great advantage of this is that users do not need to have a local MS InfoPath rich client installed. They just use their web browser to open and fill in the form.

If the Forms Service is properly configured (see more details about this in Chapter 8), you can configure the Forms library to automatically display all new and existing forms as HTML web forms; just follow the steps in the Try It Out below.

Try It Out Display Forms as HTML Web Forms

image from book
  1. Open the Vacation library.

  2. Click Settings image from book Form Library Settings, then click Advanced Settings.

  3. Set the option Display as a Web page in the Opening browser-enabled documents section. Next click OK, then open the library again.

  4. Now try it out. Click New, and the form is displayed as a web page.

image from book



Beginning SharePoint 2007 Administration. Windows SharePoint Services 3 and Microsoft Office SharePoint Server 2007
Software Testing Fundamentals: Methods and Metrics
ISBN: 047143020X
EAN: 2147483647
Year: 2004
Pages: 119

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