Design a form for merging InfoPath 2007
Author: mety Labels:: Design a form for merging InfoPath 2007With form merging, your users can consolidate data from many different forms into one form. This is useful when your users want to compare or summarize data from several related forms. For example, it can be useful for a manager whose team fills out weekly status report forms to merge data from those forms into a single summary report for her director. Ways that users can merge formsThe location of a form determines how a user can merge it with other forms. The following list explains the different locations where Microsoft Office InfoPath forms can be stored and how users can merge forms that are stored in those locations:
Note When users merge forms, the original forms are not deleted. The data from the merged forms is added to the target form. It is recommended that users save the target form, with merged data, as a new form so as not to overwrite the data in the original form. Design considerationsNow that you are familiar with the ways that users can merge forms based on a form's location, it is important to understand how you can enable specific controls to support merging, and how data from individual fields (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) is combined when forms are merged. This information — along with an understanding of how your users plan to use merged data — is a key part of creating form templates that enable users to can easily merge forms.When you add a control to a form template, it 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 a field or group in the form template's data source (data source: The collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in the data source.). If you design a new, blank form template, the data source is created for you when you add controls. If you design a form template that is based on an external data source, such as an XML Schema or a Web service, the controls that you add to the form template must be bound to fields or groups in that data source. When you enable merge settings for a control, you actually enable merge settings for the field or group that the control is bound to. The merge settings vary depending on the field or group and its data type. Certain types of fields or groups do not support merging. To better understand how form merging works, imagine that you designed an expense report form template that contains a text box control bound to a non-repeating field in the data source that uses a text data type. This field is used to store each user's business justification for the recorded expenses. For this example, we will call the field purpose and bind the text box control with the label Business Purpose to it. Imagine that three users — Bob Kelly, Nate Sun, and Judy Lew — are filling out forms based on your form template. In the Business Purpose field, Bob types Conference, Nate types Customer Visit, and Judy types Business Trip. Because text box controls that use a text data type do not support the merging of data by default, a manager who merges these expense report forms will only see one value in the Business Purpose field — the value that was already contained in the target form. So, for example, if Judy's form is the target form, only the value that Judy entered will appear in the merged form for this field. By customizing the merge settings for the field or group that a control is bound to, users can merge that field's or group's data from multiple forms. In this example, you can customize the merge settings for the Business Purpose text box control so that users can merge data from the forms that contain that field. You can customize the merge settings further by enabling a separator to appear between each merged value. A separator can be a space, a comma, a semicolon, a vertical line, a line break, a paragraph break, or an underline. For example, if Bob types Conference in the Business Purpose field, Nate types Customer Visit, and Judy types Business Trip, and you enable merging for that field, and specify a comma separator, the resulting merged data will display as Business Trip, Customer Visit, Conference (if Judy's form is the target form). Note A space is automatically added after comma and semicolon separators. While adding a separator can help distinguish between specific values, you can further customize how data is merged by adding a unique prefix to each value that is contained in a field or group. When adding a prefix, you can select the value from another field, or enter a function (function: A predefined XPath expression that returns a value based on the results of a calculation.) that you want to use as a prefix. Adding a prefix can help your users identify the source of the original data. For example, you can enable the name of the person who filled out a form — a value that is entered in another field — to appear as a prefix for a value contained in another field. Then, when several forms are merged, the values from the source form will display merged values, and those values will have identifiers. For example, if you identify a field that stores a user's name as the prefix, and create a concat function that adds a colon after each instance of that value, users can easily see who entered a value even after several forms are merged. In this example, if Judy Lew's form is the target form, the resulting prefixed data will appear as Business Trip, Nate Sun: Customer Visit, Bob Kelly: Conference. Notes
Merge actions for fields and groupsThe following merge actions vary, depending on the data type of the field or group.When you configure merge settings for any type of field or group, you can either choose to ignore the values in the source forms and keep the values in the target form, or choose a custom merge setting. The following table describes the custom merge settings for each type of field or group.
Defining custom merge settings for controlsUse the procedures in this section to define custom merge settings for standard and repeating controls.Note When you enable merge settings for a control, you actually enable merge settings for the field or group that the control is bound to. The merge settings vary depending on the field or group and its data type. Certain types of fields or groups do not support merging. You can also change merge settings by editing the properties for a field or group in the data source. To do this, right-click a field or group in the Data Source task pane, click Properties on the shortcut menu, and then on the Rules and Merge tab, click Merge Settings. Standard controls include the controls that you typically associate with collecting and displaying information. These controls include text boxes, list boxes, check boxes, and buttons. Repeating and optional controls include list controls, repeating tables, repeating sections, and optional sections. These controls allow users to insert list items, rows, record sets, and optional information when filling out a form. For example, in an expense report form template, you can use a repeating table to allow users to add as many rows as they need to enter their specific number of expense items. Notes
Define custom merge settings for standard controlsStandard controls include text boxes, rich text boxes, and combo boxes. See Merge actions for fields and groups in this article for more information.Note Controls that are added inside sections — in other words, child controls of parent controls — only support merging if it has been enabled for the parent control.
Define custom merge settings for a standard sectionStandard sections are containers for other controls. Sections can include any of the controls listed in the Controls task pane, including other sections. See Merge actions for fields and groups in this article for more information.Note Controls that are added inside sections — in other words, child controls of parent controls — only support merging if it has been enabled for the parent control.
Define custom merge settings for repeating controls and sectionsRepeating controls include repeating sections, repeating tables, and bulleted lists. See Merge actions for fields and groups in this article for more information.Note Controls that are added inside sections — in other words, child controls of parent controls — only support merging if it has been enabled for the parent control.
Define custom merge settings for optional sectionsOptional sections contain other controls. Users can insert or remove optional sections when filling out a form. See Merge actions for fields and groups in this article for more information.Note Controls that are added inside sections — in other words, child controls of parent controls — only support merging if it has been enabled for the parent control.
|