Lab 2: Designing Forms in InfoPath 2003
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Summary: Learn how to lay out, add controls, and add a color scheme to a simple sales form. In addition, learn how to select print settings and preview the form. (6 printed pages)
Updated August 2007
Applies to: Microsoft Office InfoPath 2003
Download the odc_INF03_Labs.exe sample file.
Exercise 1: Specifying Form Layout Options
When you design an InfoPath form, you can use layout tables to help you arrange controls and text in your form. This exercise shows you how to add several layout tables to your form.
Before you can start adding layout tables, you must create a new form.
To create a blank form
In the Fill Out a Form dialog box, click Design a Form.
In the Design a Form task pane, click New Blank Form. After you create your form, you can insert a title that describes the form's purpose.
To insert a title
In the Design Tasks task pane, click Layout.
In the Insert layout tables list in the Layout task pane, click Table with Title.
In the form, click the Click to add a title placeholder text, and then type Contoso Sales Report.
Select the title text, and then, on the Standard toolbar, click Bold. Now that you have added a title to your form, you are ready to create your form's layout.
To insert a layout table
Move your cursor underneath the table that contains the form title, and then press ENTER.
On the Standard toolbar, click Insert Layout Table.
Use the expanded menu to select a 2 rows x 3 columns Table.
At this point, your form should look like Figure 1.
Exercise 2: Inserting Controls
When users fill out forms, they enter information by typing in text boxes, clicking items in lists, selecting check boxes, and performing other actions. The objects that users interact with are called controls. This exercise shows you how to insert controls into your form.
Before you begin adding controls to your form, you want to add labels for the controls.
To add labels to controls
With the form from Exercise 1 still open, place your cursor in the first cell at the top of the table, type Sales Representative:, and then press ENTER.
Type additional labels and adjust column widths in the layout table so that your form looks like Figure 2.
Now that you have added labels, you are ready to insert controls in the form.
To insert controls
At the top of the Layout task pane, click Controls.
From the Insert controls list in the Controls task pane, drag a Text Box control onto the form under the Sales Representative label.
From the Insert controls list, drag the Drop-Down List Box control onto the form under the Period label.
In the form, double-click the list box you just inserted.
Under List box entries in the Drop-Down List Box Properties dialog box, click Add.
In the Value box in the Add Choice dialog box, type January 2004, and then click OK. Repeat this step to add entries for February 2004 and March 2004 so that the List Box Properties dialog box looks like Figure 3.
From the Insert controls list in the Controls dialog box, drag the Text Box control onto the form under the E-mail Address label.
From the Insert controls list, drag the Drop-Down List Box control onto the form under the Department label.
For this lab, we leave the Department list box empty.
Your form should now look like Figure 4.
Exercise 3: Adding Repeating Controls
Contoso sales representatives typically visit many customers in a given month. In the next exercise, you add a repeating "customer name" section to the form to collect customer data. Sales representatives can insert as many of these sections as they need into their sales report forms.
To insert a repeating section
With the form from Exercise 2 still open, drag a Repeating Section control from the Controls task pane onto the form, just under the second layout table.
Click inside the repeating section, and then type Customer Name:.
From the Insert controls list in the Controls task pane, drag the Text Box control onto the form next to the Customer Name label.
To change the width of the text box, double-click it, and then, in the Text Box Properties dialog box, click the Size tab.
Under Size, in the Width box, type 300. Leave px as the unit of measurement.
Customers frequently purchase multiple products from Contoso sales representatives. If you include a repeating table inside the repeating section, sales representatives can record the details about each product they have sold to a customer.
To insert a repeating table
From the Insert controls list in the Controls dialog box, drag a Repeating Table control onto the form under the Customer Name box.
In the Number of columns box in the Insert Repeating Table dialog box, click 4, and then click OK.
Above each cell in the table you inserted, type Name, Price, Units Sold, and Total for the column titles.
Your form should now look like Figure 5.
Exercise 4: Inserting Optional Sections
Customers occasionally ask Contoso sales representatives to handle their order in a customized manner. To record these special requests, or to record other supplementary notes about the customer, you can create an optional "Notes" section in the sales report form. This section will not appear unless the person filling out the form chooses to add it.
To insert an optional section
With the form from Exercise 3 still open, click More Controls on the Insert menu.
From the Insert controls list in the Controls task pane, drag the Optional Section control onto the form under the repeating table but inside the repeating section.
To add a label to the optional section, click inside the optional section, and then type Notes:.
From the Insert controls list in the Controls task pane, drag the Rich Text Box control onto the form under the Notes: label. You use this rich text box to store notes about each customer.
Your form should now look like this:
Exercise 5: Applying a Color Scheme
The form that you have created looks fairly plain. You can apply a color scheme to the form to make it look more interesting.
To apply a color scheme
On the Format menu, click Color Schemes.
In the Apply a color scheme list in the Color Schemes task pane, click Burgundy.
Your form should now look like Figure 7.
Exercise 6: Adding a Footer and Page Breaks to the Form
Contoso sales representatives frequently print copies of their form before submitting them to management. Therefore, you should consider how your form will look when it is printed. In the following exercises, you learn how to add footers and page breaks to your form.
To insert a footer
On the View menu, click Header and Footer.
On the Print Settings tab in the View Properties dialog box, click Footer.
In the Print form with this footer text box in the Footer Format dialog box, type Contoso Confidential. Page.
In the Insert Auto Text list, click Current Page.
The text in the Print form with this footer text box should look like this:
Contoso Confidential. Page &p
If you want data about each customer to print on a separate page, you can add a page break after the repeating "customer name" section.
To insert a page break
In the form, place your cursor underneath the repeating section.
On the Insert menu, click Page Break.
In design mode, a page break appears as a dashed line in the form area. If you preview your form, you will not see this dashed line or any other indication of the page break. To see how the page break affects your form when it is printed, click Print Preview on the Standard toolbar.
Exercise 7: Previewing the Form
Before publishing the sales report form, you can test its functionality and appearance in a special preview window. Previewing and testing your form lets you see and work with the form from your user's perspective.
To preview the form
On the Standard toolbar, click Preview Form.
The form opens in a new window.
To test the controls in the form, do the following:
To add a row to the repeating table, put your cursor inside the table, and then press CTRL+ENTER.
To insert a new "customer name" section, click Insert item at the bottom of the form.
To insert the optional "Notes" section, click Click here to insert.