Microsoft Infopath Tutorial and Online Training Course
Microsoft InfoPath Tutorial: Section 5 Overview
In this section, you will learn about:
Formatting a form
Formatting text
Customizing tables
Inserting pictures
Creating repeating sections
Creating optional sections
Merging forms
Customizing Form Layout
Formatting a Form
Several options are available for quickly defining a form’s formatting. Some of these are specific to the view you’re designing, while others apply to all the views.
Use the View Properties dialog to define default formatting properties of the current view, such as the background color, layout width, and formatting:
From the View menu, select Manage Views.
This opens the Views task pane, where you can select the view you want to work with:
Select a view from the list click the View Properties button at the bottom of the task pane.
The View Properties dialog opens.
Use the General tab to specify a background color and layout width for the form in this view.
You can also use this tab to specify this view as the default, if it isn’t already, and to specify whether or not you want the view to appear in the InfoPath View menu.
Use the Text Settings tab to specify formatting for the controls. Each view can use different formatting. This is handy if, for example, some users need larger text.
When you’ve finished, click OK.
Color schemes apply to all the form’s views. When you apply a color scheme to a form, InfoPath uses custom table formatting, including borders and shading, and heading styles when you insert these elements into the form. To apply a color scheme:
From the Format menu, or from the task pane menu, select Color Schemes.
This opens the Color Schemes task pane, which displays a list of various color schemes you can select:
Click on a color scheme to apply it to the form:
Formatting Text
You format text in InfoPath the same way you do in other Office applications. The Formatting toolbar provides options for changing the font, size, appearance, alignment, and color of text. You can also use the buttons on the toolbar to created bulleted and numbered lists.
To display the Formatting toolbar, open the View menu, select Toolbars, and then select Formatting from the submenu.
InfoPath also includes a Font task pane, which you can access by selecting Font from the task pane menu. In addition to standard formatting options, the Font task pane includes a list of heading styles, which you can use to quickly format the headings on your form.
To format text, select it, or place your cursor where you plan to type, and then select options from the Font task pane, or click the buttons on the Formatting toolbar:
To quickly clear all formatting from selected text, select Clear Formatting from the list under Pick formatting to apply on the Font task pane.
Customizing Tables
The InfoPath Table menu contains the same commands for customizing tables that are available in other Microsoft Office products—such as Insert, Delete, and Merge Cells. These commands are also available from the shortcut menu when you right-click on a table.
In addition, the Layout task pane contains common commands for modifying tables (if necessary, select Layout from the task pane menu):
Add Table Row adds a row at the bottom of the table, while Add Table Column adds a column to the right of the table. Use the Split and Merge commands to divide and combine cells.
To resize columns or rows in a table, click and drag the borders:
If you make a mistake, it’s easy to delete a table. Position your cursor inside the table you want to delete, then click on the table handle that appears at the upper left corner.
This selects the table:
Press Delete to delete it.
Likewise, you can select and delete columns and rows. Just click and drag to select the range of cells you want to delete:
Add a border or shading to a table by selecting the table or the cells and then selecting Borders and Shading from the Table menu. This opens the Borders and Shading dialog:
Choose a border style, color, and width on the Borders tab. If you applied a color scheme to the form, the colors belonging to the scheme appear along the top of the Color menu:
Select the Shading tab to apply a fill color to the cells.
Click OK to apply the settings.
Inserting Pictures
You can customize the appearance of your form for your company by inserting pictures such as company logos or employee photos:
Click inside the table cell where you want the picture to appear.
From the Insert menu, select Picture, and then From File, or click the Insert Picture button on the Standard toolbar.
In the Insert Picture dialog, navigate to the picture you want to insert and click Insert.
Tip:
To specify properties for a picture or horizontal line, such as size, text wrapping, and alternate text, click on it and press Alt + Enter.
Creating Repeating Sections
A repeating section is a section that can be expanded when necessary to accommodate additional entries to a form when the number of entries isn’t predictable. For example, a form containing a list of projects assigned to an employee, or a tax form showing the number of the user’s dependents, may need a different number of fields for different users. Repeating sections allow users to add more fields when necessary to accommodate the information they need to provide. They also allow you to design a dynamic form that adjusts in size depending on the amount of data being displayed.
A repeating section is like a mini-form, a region in which you add and arrange all the controls that need to be repeated. You can add a layout table to a repeating section to control the appearance, and then add controls and labels to the table’s cells, just as you would to layout tables on other parts of the form.
If you want data to be repeated inside a table—such as an entry in each row—or you want users to be able to add and delete rows as necessary, you should add a repeating table instead of a repeating section.
You can add repeating sections inside other repeating sections, so for each section of your form, a user can include as much information as necessary. For example, if we’ve created a section containing fields that describe a project, we might want to insert a repeating section for associated project tasks. With the repeating section inserted inside the project section, the user can add as many tasks as necessary for a single project record. Furthermore, we might want to include risks associated with each task. To do this, we’d insert another repeating section inside the repeating section containing the task fields. This way, each project can have multiple tasks, and each task can have multiple risks.
Repeating sections and tables are bound to groups in the data source, with the controls inside the repeating section or table corresponding to the fields in the group. When you insert a repeating section or table, InfoPath automatically adds a group in the Data Source task pane, and adds fields to the group that correspond to the controls you add to the section or table:
You can add a repeating section from either the Layout task pane or the Controls task pane:
From the task pane menu, select either Layout or Controls.
On the Layout or Controls task pane, click Repeating Section.
The repeating section is added to the form:
Note:
The grey border won’t be visible to the user.
Double-click the section to enter a name for it into the Repeating SectionProperties dialog:
Click inside the repeating section, and then click a control to add to the section. All the controls in this section can be repeated, or displayed again, as many times as necessary for the user to add all of his or her information.
Add labels and format the controls as necessary:
Repeating tables are only available on the Controls task pane:
From the task pane menu, select Controls.
On the Controls task pane, click Repeating Table.
The Insert Repeating Table dialog opens, prompting you to specify the number of columns you want in the table:
Note:
In design mode, repeating tables are displayed with only one row containing data and one row at the top, where you type column labels.
Enter the number of columns and click OK.
The repeating table is added to the form:
If you applied a color scheme to the form, the repeating table displays the properties of the color scheme.
Type column labels into the top row.
By default, InfoPath inserts a text box control into each column of the repeating table. You can convert the text boxes to another kind of control by right-clicking the text box, selecting Change To, and then selecting the control you want to use.
Repeating sections include shortcut menus and commands on the InfoPath menu bar to allow the user to customize the space—such as inserting and deleting rows for a repeating table. Use the Properties dialog to define the commands you want to be available to your users.
To add commands to a repeating table:
Double-click on the repeating table. It’s easiest to double-click on the tab.
The Repeating Table Properties dialog opens.
On the Data tab, click the Customize Commands button.
The Table Commands dialog opens.
Select a type of command from the Action menu. For example, you may want users to be able to insert rows at the end of the table and remove rows. For the first command, select Insert Below. When you’re ready to define the second command, select Remove.
For each command, InfoPath selects default locations where the command will appear. The menus in the list refer to the menus on the InfoPath menu bar. The shortcut menu refers to the menu that appears when the user clicks the arrow button next to the repeating table.
Check the locations where you want the command to appear. Then, for each location, highlight it in the list and type a command into the Command name field. This command is what the user sees in the menu.
When you’ve finished, select the second action, or command type, and repeat the above step.
Click OK.
Preview the commands by clicking Preview Form on the Standard toolbar.
In the preview window, open the menus where you added the commands, and click the shortcut button next to the repeating table to see the shortcut commands.
To close the preview window, click the Close Preview button on the Standard toolbar.
Adding commands for repeating sections works much the same way: Double-click the section and, in the Repeating Section Properties dialog, click the Modify button.
In the Section Properties dialog, click the Customize Commands button to open the Section Commands dialog.
In the Section Commands dialog, add the commands you want to be available to the user.
Creating Optional Sections
Optional sections are sections that users can insert and remove as necessary. By default, they don’t appear in the form. As an example, we might want to allow users to add comments about a project task. We can insert an optional section to contain the comment field inside the repeating section that contains the task fields:
On the Layout or Controls task pane, click Optional Section.
The optional section is added to the form:
Note:
The border won’t be visible to the user.
Click inside the section, and then add text and controls as necessary.
Double-click on the optional section, on or near the tab, to open the Section Properties dialog.
On the Data tab, under Binding, enter a name for the corresponding group in the data source.
Under Default settings, specify whether or not you want the section to be visible by default. To customize commands for the user, click the Customize Commands button.
Click OK.
Preview the form by clicking Preview Form on the Standard toolbar.
When you click on the link, the section appears:
Merging Forms
You can enable merging for the forms you design, allowing users to merge data from multiple forms into one. This is handy for managers, for example, who need to collect and analyze data from several users at once.
To enable form merging:
From the Tools menu, select Form Options.
Note:
You must be in design mode.
In the Form Options dialog, make sure the General tab is selected.
Select the Enable form merging check box.
To merge the forms:
From the File menu, select Fill Out a Form.
Using the Fill Out a Form task pane, open the form that you want to merge the others into. The form must have form merging enabled.
From the File menu, select Merge Forms.
Use the Merge Forms dialog to navigate to and select the form(s) you want to merge. To select more than one form, hold down the Ctrl key while you click each form you want to merge into the current one.
Click Merge.
The data from the selected forms is merged into the current one. Data from repeating tables and sections, as well as items in list controls and rich text boxes, are combined, while the remaining sections of the control are not.