Export (0) Print
Expand All

Lab 2: Designing Forms in InfoPath 2003

Office 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)

Microsoft Corporation

April 2004

Updated August 2007

Applies to: Microsoft Office InfoPath 2003

Contents

Download the odc_INF03_Labs.exe sample file.

Each month, sales representatives from Contoso Corporation visit various countries or regions around the world to sell Contoso products to customers. At the end of each month, Contoso's management team wishes to receive a form listing all the sales in a given country or region.

In this lab, you learn how to do the following:

  • Lay out a simple sales form.

  • Add controls to the form.

  • Add a color scheme to the form.

  • Select printing settings for the form.

  • Preview the finished form.

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

  1. Start InfoPath.

  2. In the Fill Out a Form dialog box, click Design a Form.

  3. 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

  1. In the Design Tasks task pane, click Layout.

  2. In the Insert layout tables list in the Layout task pane, click Table with Title.

  3. In the form, click the Click to add a title placeholder text, and then type Contoso Sales Report.

  4. 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

  1. Move your cursor underneath the table that contains the form title, and then press ENTER.

  2. On the Standard toolbar, click Insert Layout Table.

  3. Use the expanded menu to select a 2 rows x 3 columns Table.

At this point, your form should look like Figure 1.

Figure 1. Table with layout

Table with layout

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

  1. 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.

  2. Type additional labels and adjust column widths in the layout table so that your form looks like Figure 2.

    Figure 2. Table with labels added

    Table with labels added

Now that you have added labels, you are ready to insert controls in the form.

To insert controls

  1. At the top of the Layout task pane, click Controls.

  2. From the Insert controls list in the Controls task pane, drag a Text Box control onto the form under the Sales Representative label.

  3. From the Insert controls list, drag the Drop-Down List Box control onto the form under the Period label.

  4. In the form, double-click the list box you just inserted.

  5. Under List box entries in the Drop-Down List Box Properties dialog box, click Add.

  6. 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.

    Figure 3. List Box Properties dialog box

    List Box Properties dialog box
  7. From the Insert controls list in the Controls dialog box, drag the Text Box control onto the form under the E-mail Address label.

  8. From the Insert controls list, drag the Drop-Down List Box control onto the form under the Department label.

    NoteNote

    For this lab, we leave the Department list box empty.

    Your form should now look like Figure 4.

    Figure 4. Form with controls

    Form with controls

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

  1. 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.

  2. Click inside the repeating section, and then type Customer Name:.

  3. From the Insert controls list in the Controls task pane, drag the Text Box control onto the form next to the Customer Name label.

  4. To change the width of the text box, double-click it, and then, in the Text Box Properties dialog box, click the Size tab.

  5. 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

  1. From the Insert controls list in the Controls dialog box, drag a Repeating Table control onto the form under the Customer Name box.

  2. In the Number of columns box in the Insert Repeating Table dialog box, click 4, and then click OK.

  3. 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.

    Figure 5. Form with repeating table

    Form with repeating table

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

  1. With the form from Exercise 3 still open, click More Controls on the Insert menu.

  2. 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.

  3. To add a label to the optional section, click inside the optional section, and then type Notes:.

  4. 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:

    Figure 6. Form with optional section

    Form with optional section

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

  1. On the Format menu, click Color Schemes.

  2. In the Apply a color scheme list in the Color Schemes task pane, click Burgundy.

    Your form should now look like Figure 7.

    Figure 7. Form with color scheme

    Form with color scheme

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

  1. On the View menu, click Header and Footer.

  2. On the Print Settings tab in the View Properties dialog box, click Footer.

  3. In the Print form with this footer text box in the Footer Format dialog box, type Contoso Confidential. Page.

  4. 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

  1. In the form, place your cursor underneath the repeating section.

  2. 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

  1. On the Standard toolbar, click Preview Form.

    The form opens in a new window.

  2. 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.

Show:
© 2014 Microsoft