Filter the data that is displayed in a control InfoPath 2007
Author: mety Labels:: Filter the data that is displayed in a control InfoPath 2007When you design a Microsoft Office InfoPath form template, you can use filters to limit the choices that users can make when they fill out a form that is based on that form template. A filter is a set of conditions that is applied to data to display a subset of that data. You can use filters to display a subset of the data from a 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.), which reduces the number of records that are displayed in a control. Use a filter whenever you need to display a subset of the data that is returned by a query that is based on criteria selected by a user. That criteria can be an item that is selected in another control (such as a list box, combo box, drop-down list box, or text box) that 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 in the data source. For example, imagine that you are creating a form template that will be used to track the products from several suppliers. If you display all the products from all your suppliers, the list can be very long. To solve this problem, you can use a filter that enables your users to select a supplier from the list and view only that supplier's products. When a user selects a supplier from the list box, a filter is applied to the repeating table to show only the products from the selected supplier. If the user selects another supplier, the repeating table is updated with the products from the other supplier. Tip If you know that your users will require a consistent subset of a query result, modify your query to return only this subset instead of using a query to retrieve all the data and then applying a filter to create a subset. Your users will experience faster form load times and spend less time waiting for query results because the query returns only the data from the external source that you need. To show your users that a filter is applied to data, the filter icon appears when the user moves the mouse pointer over the filtered data. Because filters limit the number of items that are displayed to a user, they can be applied only to the following types of controls:
Compatibility considerationsFilters can be used only in form templates that are designed to be filled out in InfoPath. Filters are not available in browser-compatible form templates (browser-compatible form template: A form template that is designed in InfoPath by using a specific compatibility mode. A browser-compatible form template can be browser-enabled when it is published to a server running InfoPath Forms Services.). If you are using a list box and a repeating table in a browser-compatible form template, consider using conditional formatting instead of filters. Find links to more information about how to use conditional formatting in the See also section. Set a filter for a list box, drop-down list box, or combo boxTo configure a filter in a list box, you need either a list box, drop-down list box, or combo box control in your form template that 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 data source with a data connection (data connection: The connection between an InfoPath form and an external data source, such as a database, Web service, SharePoint library, or XML file. Data connections are used to query and submit data.). You cannot filter data that has been entered manually into a control by using the Control Properties dialog box. Set a filter for a list box, drop-down list box, or combo box
Set a filter for a repeating section or repeating tableTo configure a filter in a repeating section or repeating table, you need to include a section or table in your form template that meets the following requirements:
For example, you can use a text box control in a repeating section to display the data in a field. Set a filter for a repeating section or repeating table
In the preview window, select different values in the filter control to test that it is working correctly. If the values in the control that contains a filter are not correct, either because there are too many values or not enough values, try the following:
|