Design a form template by using settings in a data connection library in InfoPath 2007
Author: mety Labels:: Design a form template by using settings in a data connection library in InfoPath 2007This article shows you how to design a form template, which is based on the settings stored in a data connection library on a Microsoft Office SharePoint Server 2007 site, that can either query or submit data. A secondary data connection is any data connection to an external data source that you add to a form template. This data connection is different from the main data connection that is created when you design a form template based on a database, Web service, or settings in a connection library. You add a secondary data connection only if you cannot query or send data through the main data connection. A form can have one primary data connection, called the main data connection, and it can optionally have one or more secondary data connections. Depending on your goals for the form, a data connection might query or submit form data to an external data source, such as a Microsoft SQL Server database or a Web service. If you are designing several form templates that use similar data connections, consider using a data connection file instead of creating a data connection to an external data source for each form template. This way, you need to update only one data connection file when the data connection information changes for a set of related form templates. For example, when you move your form templates from a test network to a production network, you need to update the data connection settings only once in the connection library instead of updating the data connection in each form template. When a form based on a form template that uses a data connection file uses the data connection, the data connection is automatically updated with the new settings. A data connection file is an XML file with an .xml or .udcx file extension that contains connection information for a single external data source. This file is stored in a data connection library on a server running Microsoft Office SharePoint Server 2007. A data connection file is created by a developer or by converting a data connection in an existing form template into a data connection file by clicking the Convert button in the Data Connections dialog box (Tools menu). Advantages of using data connection files include:
Microsoft Office InfoPath uses data connection files that follow the Universal Data Connection version 2.0 file format. This version is a superset of the version 1.0 file format used by Microsoft Office FrontPage and Microsoft Office Excel. InfoPath cannot use data connection files in the version 1.0 file format. When you create a form template that is based on settings in a data connection file, Microsoft Office InfoPath creates a data connection that is based on the settings in the data connection library. If the data connection file contains settings for a query data connection, InfoPath creates the form's main 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.) with query fields (query field: A field that can contain a value that is used in a query.), data fields (data field: A field that contains the result of a query to an external data source.), and groups (group: An element in the data source that can contain fields and other groups. Controls that contain other controls, such as repeating tables and sections, are bound to groups.) that correspond to the way that data is stored in the external data source that is referenced by the settings in the data connection file. Query fields contain the data that the external data source uses to determine what to send to the form. The results of the query are put into data fields. To enable users to query the external data source, InfoPath adds a Run Query button to the form template. Because the data structure of the query and data fields must match the way that data is stored in the external data source, you cannot modify existing fields or groups in the main data source. You can only add fields or groups to the root group in the main data source. If you are using settings for a submit data connection, InfoPath enables the Submit button on the Standard toolbar and the Submit command on the File menu of forms that are based on this form template. This allows users to submit the data in their forms to the external data source. Before you beginIn order to design a form template that is based on the settings in a data connection library, you need the following information from the data connection library administrator or the developer who created the data connection file:
Design a form template with a query data connectionIn order to design a form template that is based on a data connection file with settings for a query data connection, you must do the following:
Step 1: Design the form template based on the data connection file
Step 2: Add a control to display the data in the field
Design a form template with a submit data connectionIf the data connection file contains settings for a submit data connection, you can configure your form template to allow users to submit their form data through the data connection. When you do this, InfoPath adds a Submit button to the Standard toolbar and a Submit command to the File menu. You can configure the submit options for the form in the Submit Options dialog box (Tools menu). The submit options are configured in the same way as if you designed a form template based on a database or Web service. Find links to more information about designing a form template that is based on a database or Web service in the See Also section.
|