Using the Merge Forms Developer Sample Form [InfoPath 2003 SDK Documentation]
- Microsoft Office InfoPath 2003
- Microsoft Office InfoPath 2003 Service Pack 1
For information on using the new OnMergeRequest event available in Service Pack 1, seein the InfoPath Developer's Reference.
The Merge Forms developer sample form was created to demonstrate two types of custom merges. The first custom merge aggregates the data from two forms that serve as employee status reports. Because these two status reports are based on forms that use a common schema, the merging of the forms is referred to as an A-to-A type of aggregation. The second custom merge included in this sample aggregates the data from a form that contains a list of action items with an employee status report form. These two forms are based on different schemas and this type of custom merge therefore represents what can be called an A-to-B type of aggregation.
These sample files are located in <Drive>:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK\Samples\MForms.
This Merge Forms developer sample is based on a real-world workflow scenario. An employee creates or maintains a list of action items, ActionItemsList.xsn. The employee is also responsible for creating a weekly status report. The status report contains a section for tracking action items. Since the action items are already contained in a separate form, the employee decides to use the Merge Forms feature to combine the information.
In this sample, the employee would combine the information by opening the sample status report (ROBCARON.XML) in InfoPath and then by clicking Merge Forms on the File menu to select the form containing the action items (robcaronsactionitems.xml). Because the action items form and the status report form are based on different schema files, this is an A-to-B type of merge. This type of merge is possible because a custom merge is implemented.
Another type of merge demonstrated in the Merge Forms developer sample is an A-to-A type of merge. In this scenario, the manager, say, for both Rob Caron and Lisa Jacobson would like to combine the status reports of each of his employees for his own report. He opens his status report form (managerform.xml) and then merges his status report with the reports of his employees (ROBCARON.XML and LisaJacobson.xml).
Using the Custom Task Pane
The Merge Forms developer sample form (MSFORMS.XSN) also implements a custom task pane to display some information on how custom merging affects underlying XML files. When you open one of the status report forms in InfoPath, the custom task pane displays the following controls:
- A drop-down list box to select one of three sample source forms. The first two are status reports, which can be used to demonstrate an A-to-A type of merge. The third item is the form with a list of action items, which can be used to demonstrate an A-to-B type of custom merge when it is merged with a status report.
- A Source button for displaying the XML for the form that is selected in the drop-down list box.
- A Target button for displaying the XML for the currently loaded form.
- A Transformed Source button for displaying the annotated XML for the source.
- A Target schema button for displaying the schema for the currently loaded form.
- A Transform button for displaying the custom XSL Transformation (XSLT).
Note The buttons in the custom task pane do not actually merge the form that you select from the drop-down list box. The custom task pane in the Merge Forms sample is useful for providing information about what is happening when forms are merged. The custom task pane is used to display the actual XML of both the source and target form files, the schema of the destination form (the currently open form), and how the XSL Transformation (XSLT) process creates the merged form file. To merge a form you must click Merge Forms on the File menu and select one or more of the sample form files.