Add repeating data controls
Adding controls that collect one piece of information from a user, or that display one piece of information to a user, is easy, but sometimes it isn't enough. Sometimes, you may need to collect multiple points of data, such as a list of items for an expense report, or display multiple points of data, such as a list of users. While you can add several controls, or even a list of controls to the form, and hope that you have added enough, this is not the most efficient way to design a form. To accommodate situations like this, Microsoft InfoPath 2010 has several controls that allow you to capture or present repeating data, such as database tables or lists of varying lengths.
In this article
About Repeating Data Controls
Repeating Section
Repeating section controls contain other controls, like a regular section control, but allow you to insert as many sections as needed. For example, imagine an insurance application form where users must list the names and ages of their dependents. You could design this kind of form like a paper form, with three placeholder fields, that assumes most people have no more than three dependents. However, if someone has more than three, then they will not have any space to add additional dependents. By using a repeating section control, users can add as many fields as they need to in order to list dependents.
Only an empty container will be inserted after you insert a repeating section control into a form template. For the repeating section control to be useful, you must insert additional controls inside the repeating section control, such as table or text fields.
When users move their pointer over the repeating section, a blue button with an arrow on it appears in the upper-left corner. This is the shortcut menu button. Users can click this button to see options for inserting or removing the repeating section.
Use a repeating section when you want to:
-
Collect multiple instances of the same type of data, such as in the case of adding dependents to an insurance application.
-
Display variable amounts of data on a form, such as displaying employee records from a database and displaying 1 record if only 1 is returned, or 10 if 10 are returned.
-
Avoid empty placeholder areas that take up critical space on your form template.
Repeating Table
While repeating sections allow you to add and lay out controls like you would in a regular section, sometimes a tabular format is needed. Add a repeating table to display data in a table, such as from a database, or to enable users to add rows and enter additional tabular data.
A repeating table consists of three parts, the header row, one or more data rows, and the footer row. The header row is typically used for column headings, and the footer row can be used to insert text boxes or expression boxes that sum values from the data rows. Data rows repeat, as many times as necessary, to accommodate the data that is populated in the table, either dynamically or as a result of a user entering data into the table. There is only one header and footer row and, by default, only the header row and one data row are visible.
Use a repeating table when you want to:
-
Enable users to enter data in a structured, tabular format.
-
Collect line items, numerical data, and other types of data that are best displayed in a table.
-
Conserve space on your form template by displaying only as many rows as contain actual data.
-
Display or work with records from a database, Web service, or other data source in a table on the form template.
Repeating Recursive Section
A repeating recursive section contains other controls, can be inserted within itself, and is bound (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) to nested reference groups (reference group: A group that is associated with another group so that their properties and the properties of the groups and fields they contain always match. If the properties of one group are changed, the other group is updated automatically.). You can use repeating recursive sections to create hierarchical content, such as an outline.
Horizontal Repeating Table
A horizontal repeating table is a repeating section with a table inside that contains the indicated number of rows that repeats horizontally, and a table that contains row headers to the side. These individual components have been bundled together into a pre-configured collection that can contain or collect tabular data that, as more data is added to it, expands by adding columns instead of rows. For example, you can use a horizontal repeating table to collect sales data for each quarter. If your form template is linked to a database, you can also use a horizontal repeating table to display or work with records from that database.
A horizontal repeating table consists of two parts, the header column that appears by default, and a data column that repeats, as necessary to accommodate the data that is populated into the table, either dynamically or as a result of a user entering data into the table.
Use a horizontal repeating table when you want to:
-
Enable users to enter data in a structured, tabular format.
-
Collect data from a user that is best displayed in a table.
-
Conserve space on your form template by displaying only as many columns as contain actual data.
-
Display or work with records from a database, Web service, or other data source in a table on the form template.
Master/Detail
If you expect users to work with large amounts of data on your form—for example, with multiple records in a database—you can use a master/detail control to make it easier for them to manage that data. When a user selects an item in a master control, related information about that item appears in a detail control.
For example, you can use a master/detail control when designing a human resources form that is connected to a database of employee records. The master control can display employee name and job title, and the details control can display employee location, hire date, date of birth, and so on. In database terms, this is the equivalent of a one-to-one relationship.
Similarly, you can use the master control to display one set of records (for example, customer names) and the details control to display related records (for example, customer orders). In database terms, this is the equivalent of a one-to-many relationship.
The master/detail relationship
A master/detail control is actually a set of two related controls. One of these controls is the designated master control; the other is the designated detail control. The master control is always a repeating table. The detail control can be either a repeating table or a repeating section. You can create the master/detail relationship by inserting the appropriate repeating controls on your form and then changing the properties of each control. Or, you can insert a predefined master/detail control from the Containers section in the Controls task pane.
When you insert a master/detail control from the Controls task pane, Microsoft Office InfoPath 2010 establishes a one-to-one relationship between the master control and the detail control. This means that each selected row in the master control has only a single matching result in the detail control. In a typical one-to-one relationship, both master and detail controls are bound to the same repeating group in the data source.
If you prefer, you can specify key fields in the data source that contain related data to establish a one-to-many relationship for a master/detail control. In this type of relationship, each selection in the master control can result in multiple matches in the detail control. For example, if users select a supplier record in a master control, they can view the products that are associated with that supplier in the detail control. In a typical one-to-many relationship, master and detail controls are bound to separate repeating groups in the data source
To establish a one-to-many relationship, you must use options on the Master/Detail tab in the Properties dialog box of each control to specify the appropriate key fields.
A master/detail control is actually a set of two related controls. One control is the designated master control, and the other is the detail control. The master control is always a repeating table. The detail control can be either a repeating table or a repeating section.
Use a master/detail control when you want to:
-
Enable users who are filling out forms that are based on your form template to work more efficiently with large amounts of data.
-
Display the equivalent of a one-to-one relationship. For example, you can use a master/detail control when you design a human resources form template that is connected to a database of employee records. The master control can display an employee's name and job title, and the detail control can display an employee's location, hire date, and date of birth.
-
Display the equivalent of a one-to-many relationship. For example, you can use the master control to display one set of records (for example, customer names) and the detail control to display related records (for example, customer orders).
InfoPath provides a predefined master/detail control that you can insert by using the Controls task pane. You can also create a master/detail control by inserting a repeating table and repeating section (or two repeating tables) and then changing the properties for each control.
If your form template is intended mainly for onscreen viewing, consider placing the detail control inside a Scrolling Region control on your form template. That way, if there is a large amount of data displayed in the control, your users can scroll through the data. Note that this isn't the best option if you think users will want to print their forms, because any data that is hidden in the scrolling region onscreen will also not be visible on the printed form.
Repeating Choice Group
You can insert a repeating choice group on your form so that users can add multiple choice groups (choice group: A control that is used to present a set of mutually exclusive choices. By default, a choice group contains two choice sections, one of which appears to the user as the default choice in the form.) when filling it out.
When users move their mouse pointer over the default choice on the form, a shortcut menu button appears in the upper-left corner of the repeating choice group. Users can click this button to see options for inserting, removing, or replacing choices.
For example, on a travel form, you can use a repeating choice group to allow users to enter information about their business trips. For each transportation segment, users can select one of three choices—flight, car, or train. Each choice displays a different set of fields.
Inserting Repeating Data Controls
Insert a repeating recursive section
Note: You can insert a Repeating Recursive Section control only in a form that was created using the Blank Form (InfoPath Filler) form template, or that has Compatibility set to InfoPath Filler Form in the Form Options dialog box.
Insert a repeating recursive section (automatically create the data source)
If you choose to have Microsoft Office InfoPath 2010 create the data source when you insert a repeating recursive section, InfoPath creates a repeating group that contains a reference to itself.
-
Place the insertion point where you want to insert the repeating recursive section.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
In the Controls task pane, select the Automatically create data source check box.
Note: If the check box is unavailable, the form's design does not allow the data source to be automatically created. You must insert a repeating recursive section that is bound to an existing repeating group or to a group that you create.
-
Under Containers controls, click Repeating Recursive Section.
-
To add a control to the section, drag a control from the Controls task pane into the section.
Note: You should not move a control that is already on the form into this section, unless the control's field is already part of the section's group.
Insert a repeating recursive section (bind to an existing repeating group)
-
Place the insertion point where you want to insert the repeating recursive section.
-
If the Fields task pane is not visible, click Show Fields in the Form Data section on the Data tab.
-
In the Fields task pane, right-click the group that you want the repeating recursive section to be bound to.
-
Click Repeating Recursive Section.
Note: The group must repeat and must contain a reference to itself. To create such a group, right-click a repeating group in the Fields task pane, click Reference, and then reference the group itself (the group you right-clicked).
Tip: You can also insert a repeating recursive section that is bound to an existing group by using the Controls task pane, as long as the Automatically create data source check box is cleared.
Insert a Repeating Choice Group
Insert a repeating choice group (automatically create the data source)
You can have Microsoft Office InfoPath 2010 automatically create the data source when you insert repeating choice groups (as well as other controls). If you do this, InfoPath creates groups that are bound to the choice sections inside the repeating choice group. In addition, InfoPath creates a "virtual" group that is bound to the repeating choice group. The name of a virtual group is followed by (choice) in the Fields task pane.
Note: You can insert a Repeating Choice Group control only in a form that was created using the Blank Form (InfoPath Filler) form template, or that has Compatibility set to InfoPath Filler Form in the Form Options dialog box.
-
Place the insertion point where you want to insert the repeating choice group.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
In the Controls task pane, select the Automatically create data source check box.
-
Under Containers, click Repeating Choice Group.
A repeating choice group containing two choice sections appears on the form.
-
To add controls to the choice sections inside the repeating choice group, do one of the following:
-
To add controls to the default choice section, drag the control that you want from the Controls task pane into the choice section that is labeled Choice Section (default).
-
To add controls to the alternative choice section, drag the control that you want from the Controls task pane into the choice section that is labeled Choice Section.
-
-
To test the section, on the Home tab, click Preview.
To offer more than two options to users, you can insert additional choice sections inside the repeating choice group. To do this, place your insertion point inside the repeating choice group, and then click Choice Section under Containers in the Controls task pane.
Insert a repeating choice group (bind to an existing group)
-
Place the insertion point where you want to insert the repeating choice group.
-
If the Fields task pane is not visible, click Show Fields in the Form Data section on the Data tab.
-
In the Fields task pane, right-click the group that you want to bind the repeating choice group to, and then click Repeating Choice Group.
Note: If Repeating Choice Group is not available, the group to which you are trying to bind may not support this type of control. Repeating choice groups can be bound only to repeating virtual groups. In the data source, virtual groups appear as (choice).
-
To test the section, on the Home tab, click Preview.
Tip: You can also insert a repeating choice group that is bound to an existing group by using the Controls task pane, as long as the Automatically create data source check box is cleared.
Insert a repeating table
-
Place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
Under Containers, click Repeating Table.
-
If you are inserting the repeating table onto a new, blank form template, then:
-
In the Number of columns box, enter the number of columns that the table should have, and then click OK.
-
The repeating table is created with a text box in each column. To convert a text box to a different type of control, right-click the text box, point to Change Control, and then click the control that you want.
-
-
If you are inserting the repeating table into a form template that is based on an existing data source:
-
On the first page of the Repeating Table Binding wizard, click the data source that you want to use in the Data source list, and then click the repeating group that you want to bind the table rows to.
To create a new repeating group, right-click the group to which you want to add the repeating group, click Add on the shortcut menu, and then in the Add Field or Group dialog box, specify the properties for the repeating group.
-
Click Next.
-
On the second page of the Repeating Table Binding wizard, double-click the fields in the Data binding list that you want to add as columns to the table.
To create a new field in the Data binding list, right-click the group to which the repeating table is bound, click Add, and then in the Add Field or Group dialog box, specify the properties for the field.
-
To reorder the columns, select a column in the Columns in table list, and then click Move Up or Move Down.
-
Insert a repeating section
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
Under Containers, click Repeating Section.
-
If you are inserting a repeating section into a new, blank form template:
-
To add controls to the repeating section, drag the controls that you want from the Controls task pane into the repeating section on your form template.
Note: You should not move a control that is already on the form template into the section, unless the control's field is already part of the section's group in the data source. Otherwise, the binding for the control might break.
-
To add a label to the control, type text above it.
-
-
If you are inserting a repeating section into a form template that is based on an existing data source:
-
In the Repeating Section Binding dialog box, select the repeating group in which you want to store repeating section data, and then click OK.
-
Add controls to the repeating section, and then bind them to the appropriate fields in the data source.
-
InfoPath uses the name of the field or group as the control's label. If necessary, change the label text.
You can also use the Fields task pane to insert controls. In the Fields task pane, right-click the repeating group that you want to bind the repeating section to, and then click Repeating Section.
-
Insert a Master/Detail control
Note: You can insert a Master/Detail control only in a form that was created using the Blank Form (InfoPath Filler) form template, or that has Compatibility set to InfoPath Filler Form in the Form Options dialog box.
Insert a master/detail control on a new, blank form template
InfoPath provides a predefined master/detail control that you can insert by using the Controls task pane. You can also create a master/detail control by inserting a repeating table and a repeating section (or two repeating tables) and then changing the properties for each control.
When you design a new, blank form template, the Automatically create data source check box in the Controls task pane is selected by default. This enables InfoPath to automatically create fields and groups in the data source as you add controls to the form template. These fields and groups are represented by folder and file icons in the Data Source task pane.
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
Under Containers, click Master/Detail.
-
In the Number of columns in master box in the Insert Master/Detail dialog box, enter the number of columns for the master control.
-
In the Number of fields in detail box, enter the number of fields for the detail control, and then click OK.
Two controls are inserted on the form template — Repeating Table (master) and Repeating Section (detail).
-
To test the master/detail relationship, on the Home tab, click Preview, and then enter data in the master control. Related data should appear in the detail control. Also, click on different rows in the master control to confirm that the corresponding data is displayed in the detail control.
Insert a master/detail control on a form template that is based on an existing data source
If you base the design of your form template on an existing Extensible Markup Language (XML) file, database, or Web service, InfoPath derives the fields and groups in the Data Source task pane from that existing data source. In this scenario, you can insert a master/detail control from the Controls task pane, as described in the following procedure.
Master and detail controls can be bound to the same repeating group or to different repeating groups, depending on your needs. The controls that appear inside a master/detail control are bound to fields that are part of a repeating group.
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
Under Containers, click Repeating Table.
-
On the first page of the Repeating Table Binding wizard, click the repeating group that you want to bind the table rows to, and then click Next. If your table has only one column, you can select a repeating field instead of a repeating group.
To create a new repeating group to bind the table to, right-click the group to which you want to add the repeating group, click Add, and then in the Add Field or Group dialog box, enter the repeating group's properties.
-
To add the columns that you want to include in the table, double-click the fields in the Data binding list.
To create a new field to add as a column, right-click the group to which the table is bound, click Add on the shortcut menu, and then in the Add Field or Group dialog box, enter the field's properties.
-
To rearrange the columns, click a column in the Columns in table list, click Move Up or Move Down, and then click Finish.
-
Double-click the Repeating Table label below the table on your form template.
-
On the Control Tools Properties tab of the ribbon, click the Master/Detail.
-
Click Set as master, type the ViewContext identifier of the master control in the Master ID box, and then click OK.
To view the ViewContext identifier of a control, right-click the control, click <Control Type> Properties, and then click the Advanced tab. The ViewContext identifier is visible under the Code section of the tab. You can highlight the value next to the ViewContext: label, and then press CTRL+C to copy the value to the clipboard. Typically when configuring a master/detail control, the master control is the repeating table itself, so you would use the ViewContext identifier of the repeating table you are configuring in this step.
-
Place the cursor on your form template where you want to insert the repeating section (the detail control).
-
Under Containers in the Controls task pane, click Repeating Section.
Alternatively, you can use another repeating table as the detail control.
-
On the first page of the Repeating Section Binding wizard, click the repeating group that you want to bind the section to, and then click OK.
-
Double-click the Repeating Section label that appears below the section on your form template.
-
On the Control Tools Properties tab of the ribbon, click Master/Detail.
-
Click Set as detail, and then click the name of the master control in the Link to master ID list. The name you select should correspond to the ViewContext identifier of the control you specified in step 9.
-
To change the default, one-to-one relationship of the master/detail control to a one-to-many relationship, click By key field under Master/detail relationship, and then click Select XPath next to the Key field (master) and Key field (detail) boxes to specify the key fields from the data source that contain the appropriate related data to create a one-to-many relationship.
-
To test the master/detail relationship, on the Home tab, click Preview, and then enter data in the master control. Related data should appear in the detail control. Also, click on different rows in the master control to confirm that the corresponding data is displayed in the detail control.
You can also use the Fields task pane to insert master/detail controls. To create the master control, in the Fields task pane, right-click the repeating group that you want to bind the master control to, and then click Repeating Table. Follow the same general steps to create the detail control.
Change the default master/detail relationship
When you insert a master/detail control on your form template by using the Controls task pane, InfoPath establishes a one-to-one relationship between the master control and the detail control. A one-to-one relationship means that for each selection in the master control, a single matching result appears in the detail control.
You can change the master/detail relationship from the default one-to-one relationship to a one-to-many relationship. A one-to-many relationship means that for each selection in the master control, multiple matching results can appear in the detail control.
When you insert a master/detail control on your form template, InfoPath inserts a repeating table and a repeating section by default. Both of these controls are bound to the same repeating group in the data source. By default, both controls contain other controls that are bound to fields in that repeating group. In a one-to-many relationship, however, master and detail controls are typically bound to separate repeating groups.
If you inserted a master/detail control on your form template from the Controls task pane, and you want to establish a one-to-many relationship instead of a one-to-one relationship, you can delete the detail control that InfoPath creates. Then you can create a new detail control that better suits your needs, as outlined in the following procedure:
-
Select the repeating section that is designated as the detail control, and then press DELETE.
-
Insert a new repeating section on the form template:
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
In the Controls task pane, select the Automatically create data source check box.
-
Under Insert controls, click Repeating Section.
-
-
Insert the controls that you want in the repeating section:
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
In the Controls task pane, select the Automatically create data source check box.
-
Under Insert controls, click the control that you want to insert.
-
Repeat steps 1 through 4 for each control that you want to insert.
-
-
Double-click the tab of repeating section on your form template.
-
Click the Master/Detail on the Control Tools Properties tab of the ribbon.
-
Under Master/detail settings, click Set as detail.
-
In the Link to master ID list, click the ViewContext identifier of the master control.
To view the ViewContext identifier of a control, right-click the control, click <Control Type> Properties, and then click the Advanced tab. The ViewContext identifier is visible under Code section of the tab. You can highlight the value next to the ViewContext: label, and then press CTRL+C to copy the value to the clipboard.
-
Under Master/detail relationship, click By key field.
-
Click Select XPath next to the Key field (master) box, and then in the Select a Field or Group dialog box, click the key field for the master control, and then click OK.
-
Click Select XPath next to the Key field (detail) box, and then in the Select a Field or Group dialog box, click the key field for the detail control, and then click OK.
If you want to create a one-to-many relationship when you initially create a master/detail control, consider manually creating your own master/detail control instead of using the predefined master/detail control that is available in the Controls task pane. You can create your own control by establishing a master/detail relationship between a repeating table and a repeating section or between two repeating tables on a form template. To do this, open the Properties dialog box for each control, and then designate one control as the master control and the other control as the detail control. By modifying the properties for the detail control, you can set up a one-to-many relationship through the use of key fields.
Insert a horizontal repeating table
Note: You can insert a Horizontal Repeating Table control only in a form that was created using the Blank Form (InfoPath Filler) form template, or that has Compatibility set to InfoPath Filler Form in the Form Options dialog box.
-
On the form template, place the cursor where you want to insert the control.
-
If the Controls task pane is not visible, click the Controls Pane button in the lower right corner of the Controls section on the Home tab.
-
Under Containers, click Horizontal Repeating Table.
-
If you are inserting a horizontal repeating table on a new, blank form template:
-
In the Number of rows box, enter the number of rows that you want the table to have by default.
-
The horizontal repeating table is created with a text box in each row in the data column. To convert a text box to a different type of control, right-click the text box that you want to convert, point to Change Control, and then click the control that you want.
-
-
If you are inserting a horizontal repeating table into a form template that is based on an existing data source:
-
On the first page of the Repeating Table Binding wizard, click the data source that you want to use in the Data source list, and then click the repeating group that you want to bind the table rows to.
To create a new repeating group, right-click the group to which you want to add the repeating group, click Add, and then in the Add Field or Group dialog box, specify the properties for the repeating group.
-
Click Next.
-
On the second page of the Repeating Table Binding wizard, double-click the fields in the Data binding list that you want to add as columns to the table.
To create a new field, in the Data binding list, right-click the group to which the horizontal repeating table is bound, click Add, and then specify the properties for the field in the Add Field or Group dialog box.
-
To reorder the columns, select a column in the Rows in table list, and then click Move Before or Move After.
-
Click Finish.
-
Layout tips for repeating data controls
Use the following tips to help you refine the appearance, size, and other aspects of the controls inside a repeating data control:
-
To change the size of several controls inside a repeating data control at once, hold down the CTRL key, select the text boxes whose size you want to change, and then make the necessary adjustments in the Control Size section on the Control Tools Properties tab of the ribbon.
-
To change the border or color of the controls inside a repeating data control at once, hold down the CTRL key, and select the text boxes that you want to change. Click the Control Tools Properties tab on the ribbon, click either Borders or Shading in the Color section of the tab, and then make the necessary adjustments.
-
To customize the text that appears in a text box inside a repeating data control, use the Font and Font Size boxes in Format Text section on the Home tab of the ribbon. Alternatively, you can use the Font Styles section on the Home tab of the ribbon
Repeating section layout tips
Use the following tips to help you refine the appearance, size, and other aspects of the controls inside a Repeating Section control:
-
On occasion, the text inside the controls in a repeating section and the labels to the left of those controls may appear to be slightly out of alignment. To quickly realign them, right-click the control, click <Control Type> Properties, click Align on the Size tab, and then click Apply. If the label and control are in different cells in a layout table, right-click the cell that contains the label, click Table Properties on the shortcut menu, and then click Center under Vertical alignment on the Cell tab.
-
The Repeat vertically option on the Display tab of the Repeating Section Properties dialog box is selected by default. This means that as users add repeating sections, those sections appear in a vertical formation down the length of the form. You can choose to make the repeating section expand horizontally by selecting the Repeat horizontally option instead. This allows you to create completely different layouts. For example, you can create a form template that resembles a calendar. The Repeat horizontally option is not supported in browser-compatible form templates.
Horizontal repeating table layout tips
Use the following tips to help you refine the appearance, size, and other aspects of a Horizontal Repeating Table control and the controls within it:
-
A horizontal repeating table consists of a repeating section inside a layout table. The right border of the layout table defines the point at which the columns in the table wrap to the next line when users insert additional columns. To control the column wrapping, you can drag the right border of the layout table cell that encloses the repeating section control to the right or left.
-
A horizontal repeating table can be useful for printing purposes. Columns in the control wrap to the next line on the form template, so that all of the information in the table is printed. However, if your form template is intended mainly for onscreen viewing, consider placing the horizontal repeating table inside a Scrolling Region control on your form template. That way, if users enter a large amount of data in the horizontal repeating table, they can scroll to view it instead of seeing it all on the form. However, note that when using a scrolling region, if a user prints the form, only the data visible onscreen in the scrolling region will be printed.
Ways to customize a repeating section
After you insert a repeating section on a form template, you can customize it by changing its properties and settings in the Repeating Section Properties dialog box. To open the dialog box, on the form template, right-click the repeating section whose properties you want to change, and then click Repeating Section Properties.
The following table describes some of the ways in which you can customize a repeating section and offers reasons why you might do so. Although the table doesn't provide detailed procedural information about the options in the Repeating Section Properties dialog box, it does give you an idea of the range of options that are available.
Notes:
-
If you are designing a browser-compatible form template, certain features in the Repeating Section Properties dialog box are not available. For example, you cannot enable the setting that allows users to insert sections horizontally, in a side-by-side formation.
-
If your form template is based on a database, schema, or other existing data source, you may not be able to customize all aspects of a control. For example, you may be able to change the size of the control but not its field or group name, which are derived from the existing data source.
Tab | Task | Details |
Data | Change group name | When you design a new, blank form template, you can change the default field or group name for a control to something that is easier to identify when you work with the data source. For example, in an insurance form template, a group named "Dependent" is easier to understand than a group named "group1." Note: Changing the group name does not change the binding between a repeating section on the form template and a repeating group in the data source. If you need to bind a repeating section to a different repeating group, right-click the repeating section, and then click Change Binding. |
Data | Prevent users from inserting and deleting the sections | By default, the Allow users to insert and delete the sections check box is selected. If you clear this check box, users won't be able to insert or delete the sections in a repeating section. This is useful in reporting scenarios where you want to display repeating data but you don't want users to change that data or add more sections. |
Data | Customize menu commands | Click Modify to further modify the section properties. For example, you can open the Customize Commands dialog box, where you can customize the names and locations of the menu commands used to insert or remove sections on the user's form. This type of customization makes your form template easier to use. For example, you can add custom commands to the Edit menu that enable users to remove repeating sections from their form. |
Data | Show or customize hint text | The Show insert button and hint text check box is selected by default. You can clear this check box if you don't want users to see instructional text on the form, or you can customize the instructional text. For example, if you have an insurance form template where users are required to enter dependents in a repeating section, you might change the "Insert item" text that appears beneath the repeating section to "Insert additional dependent." |
Display | Allow users to insert sections in a side-by-side formation instead of one after the other | The Repeat vertically option is selected by default. This means that as users add repeating sections, those sections appear in a vertical formation down the length of the form. You can choose to make the repeating section expand horizontally instead. This allows you to create completely different layouts. For example, you can create a form template that resembles a calendar. The Repeat horizontally option is not supported in browser-compatible form templates. |
Display | Filter data | Click Filter Data to open the Filter Data dialog box, where you can enable users to filter data in a repeating section based on values that the user enters or selects elsewhere on the form. For example, if you use a repeating section to collect information about current projects, you can design a list box that allows users to filter their projects by status. |
Master/Detail | Set up a master/detail relationship | On the Master/Detail tab, you can establish a master/detail relationship between a repeating table (the master control) and a repeating section (the detail control). If you set up this type of relationship, related data will appear in the repeating section based on the item that a user selects in the repeating table. Master/detail controls are not supported in browser-compatible form templates. |
Size | Adjust size, padding, and margins | You can manually specify the size of a control by entering values in the Height and Width boxes. You can also refine the spacing both inside and outside the control by changing the padding, which is the amount of buffer space surrounding the control's contents, or the margins, which is the amount of space between the control's border and any surrounding text or controls on the form template. |
Advanced | Change the tab index order | You can change the position of a control in the form template's overall tab order. Tab order is the order in which the focus moves in a form from one field or object to the next as users press TAB or SHIFT+TAB. The default tab index setting for all controls in a form template is 0, but the tab order starts with 1. That is, any control with 1 in the Tab index box will be visited first when users press the TAB key. Any control with 2 in the Tab index box will be visited second, and so on. Any controls with 0 in the Tab index box will come last in the tab order. If you want to skip controls in the tab order, enter -1 in the Tab index box. |
Advanced | Specify a ScreenTip | To make an explanatory note appear when users move their pointer over the control, enter the text that you want in the ScreenTip box. Accessibility aids, such as screen review utilities that make on-screen information available as synthesized speech or a refreshable Braille display, often rely on these ScreenTips to interpret information for their users. |
Advanced | Specify and customize the merge settings | Click Merge Settings to specify how data that users enter into the control should appear when several forms are combined. For example, you can change the order in which the repeating sections are inserted in the target form. |
Advanced | Obtain the ViewContext or XmlToEdit identifiers for the repeating section | You can use the ViewContext or XmlToEdit value to identify the control in code. For example, if you know the ViewContext value, you can use that value with the SelectText or SelectNodes methods of the View class to programmatically perform an editing action on the XML data that is bound to the control. Similarly, if you know the XmlToEdit value, you can use that value with the ExecuteAction method of the View object to programmatically insert or remove instances of a repeating control. For example, you can specify an ActionType enumeration value, such as XCollectionInsert or XCollectionRemoveAll, and the XmlToEdit name, which identifies the particular group to work with. |
Browser forms | Customize the settings for posting data back to the server | The Browser forms tab appears only when you are designing a browser-compatible form template. It allows you to control whether data is sent to the server when users insert or remove sections on the form. |
Other Actions | Apply rules | Double-click the tab on the repeating section, and then click Manage Rules in the Rules section on the Control Tools Properties tab of the ribbon. The Rules task pane is displayed, where you can use rules to apply actions when users insert or work with controls inside the repeating section. |
Other Actions | Add conditional formatting | Double-click the tab on the repeating section, and click Manage Rules in the Rules section on the Control Tools Properties tab of the ribbon, click New, and then click Formatting. This enables you to create a conditional formatting rule to change the appearance of a control, including its visibility, based on values that users enter into the form. For example, you can choose to hide a repeating section whenever a user clears a particular check box on the form. |
No comments:
Post a Comment