Insert a horizontal region InfoPath 2007

Author: mety Labels::



If you want to position two areas side by side on your Microsoft Office InfoPath form template, you can use a horizontal region. When forms that are based on your form template are resized, the horizontal region grows or shrinks to fill the available space.

Use a horizontal region when you want to organize a set of related controls in a horizontal formation. When several horizontal regions are positioned side-by-side, the regions will wrap, or flow, to the next line as the size of the screen is resized.
When you insert a horizontal region in your form template, you are essentially inserting an empty container. For the region to be useful, you must insert other controls inside it. These controls can include text boxes, list boxes, or sections. The following illustration shows two horizontal regions in design mode.
Horizontal regions containing labels and text boxes
You can also use layout tables to arrange controls in a similar manner. For example, you can position two text boxes side by side in different table cells. However, unlike horizontal regions, the cells in the layout tables do not wrap to the next line if the screen is resized; instead, the controls in the cell are hidden from sight.
In the following example, the Name and E-mail Address boxes appear next to each other in separate horizontal regions on the form.
Horizontal regions, before resizing the window
However, if the user resizes the window, the horizontal regions automatically move to the next line, as shown in the following illustration.
Horizontal regions, after resizing the window
Tip By default, the borders of a horizontal region are invisible on the form. If you want an outline to appear around your region, you can apply a border to it in the Borders and Shading dialog box.

Related controls

InfoPath includes other controls that are similar to horizontal regions but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list.

Compatibility considerations

When you design a form template, you can choose to design a browser-compatible form template (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.). When you design a browser-compatible form template, horizontal region controls are unavailable in the Controls task pane, because they cannot be displayed in a Web browser.

Insert a horizontal region

Because horizontal regions are used exclusively for layout purposes, they are not bound to fields or groups in the data source.
  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. Under Insert controls, click Horizontal Region.
  4. To add controls to the horizontal region, drag the control that you want from the Controls task pane to the horizontal region.

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a horizontal region and the controls that it contains.
  • To change the border or background color of a horizontal region, select it. On the Format menu, click Borders and Shading, and then make the necessary adjustments in the Borders and Shading dialog box.
  • To change the size of several horizontal regions at the same time, select them, press ALT+ENTER, and then make the necessary adjustments in the Properties (Multiple Selection) dialog box.
  • By default, InfoPath inserts horizontal regions at a width that matches that of the printed page. To change this default setting, on the View menu, click View Properties. On the General tab, under Layout settings, select the Use a custom layout width for this form template check box, and then type a different number in the Custom layout width box.
  • If you specify a custom layout width for horizontal regions, make sure that it isn't wider than the printable area for your form template. To quickly see how wide your printed page is — and whether the content on the form template will fit on the page — on the View menu, click Page Width Guide. When you click this command, a dashed vertical guide appears on the right side of the screen. This guide indicates the right margin of the printed page, based on the default printer for your computer.
  • You can refine the spacing both in and around the horizontal region by changing the padding, which is the amount of buffer space surrounding the region's contents, or by changing the margins, which is the amount of space between the region's border and any surrounding text or controls on the form template. To adjust the spacing for a horizontal region, double-click it. In the Horizontal Region Properties dialog box, click the Size tab, and then adjust the margin and padding options as appropriate.


0 comments |

Insert a date picker InfoPath 2007

Author: mety Labels::



A date picker is a control that lets users quickly enter dates in a Microsoft Office InfoPath form by clicking a small pop-up calendar. For example, you can use a date picker to collect birth dates from people on an insurance form. You can also use a date picker to display preset dates, such as the current date.

Use a date picker when you want to:
In the following illustration, a date picker is used on a travel request form template to collect the departure date for a flight.
Departure date entered in date picker control on form
You can customize the date picker to suit your needs by double-clicking the control on the form template and then changing its properties. For example, you can specify a default date or change the way that the date is displayed on the form.

The user experience

Date pickers look like text boxes, except that a small calendar icon appears on the right side of the box. To open the pop-up calendar, users click the calendar icon. When the calendar appears, users can click the date that they want on the calendar or use the right and left arrow buttons to scroll through the months. If users want to insert the current date, they can click the Today button at the bottom of the calendar.
Pop-up calendar

Compatibility considerations

When you design a form template in InfoPath, you can choose a specific compatibility mode to design a browser-compatible form template. When a browser-compatible form template is published to a server running InfoPath Forms Services, and then browser-enabled, forms based on the form template can be viewed in a Web browser. When you design a browser-compatible form template, some controls are unavailable in the Controls task pane because they cannot be displayed in a Web browser.
Although date pickers are available when you design a browser-compatible form template, be aware of the following limitations:
  • Date pickers are fully supported only in Windows Internet Explorer browsers. In other Web browsers, the date picker appears as a text box, although date formatting options are supported in the text box.
  • Placeholder text is text that appears inside a control on a form template. An example of placeholder text is "Click here and type." Although you can leave placeholder text settings for browser-compatible form templates, that text does not appear in Web browsers.

Insert a date picker

The procedure for inserting a date picker differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.
The following illustration shows how a date picker looks when it is selected in design mode (design mode: The InfoPath design environment in which you can create or modify a form template.).
Date picker selected in design mode
Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.
The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Date picker controls are always bound to fields. In the following example, the Departure date date picker on the form template is bound to the departureDate field in the Data Source task pane.
Relationship between date picker on form template and corresponding field in data source

Insert a date picker on a new, blank form template

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.
  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. Under Insert controls, click Date Picker.
  4. To add a label to the control, type text above or to the left of the control, followed by a colon (:).
  5. To specify the way that the date is displayed on the form, double-click the date picker that was inserted on the form template.
  6. Click the Data tab, and then click Format.
  7. In the Display the date like this list, in the Date format dialog box, click the display format that you want. Note You can change the display format of the date only if the data type (data type: Property of a field that defines the kinds of data the field can store. Examples of data types include Text, Rich Text, Whole Number, Decimal, True/False, Hyperlink, Date and Time, and Picture.) is text, date, or date and time.

Insert a date picker 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 add a date picker either by dragging a date picker field from the Data Source task pane onto the form template or by inserting the date picker by using the Controls task pane, as described in the following procedure:
  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. Under Insert controls, click Date Picker.
  4. In the Date Picker Binding dialog box, select the field in which you want to store the date picker data, and then click OK.
  5. InfoPath uses the name of the field or group as the control's label. If necessary, change the label text.
  6. To specify the way that the date is displayed on the form, double-click the date picker that was inserted on the form template.
  7. On the Data tab, click Format.
  8. In the Display the date like this list box, in the Date format dialog box, click the display format that you want. Note You can change the display format of the date only if the data type is text, date, or date and time.
Tip You can also use the Data Source task pane to insert controls. In the Data Source task pane, right-click the field that you want to bind the date picker to, and then click Date Picker on the shortcut menu.

Display the current date in a date picker

To automatically insert the current date on a form when users open it, you can use the today function with a date picker control.
  1. Insert a date picker on the form template.
  2. Double-click the date picker that you inserted on the form template.
  3. Click the Data tab.
  4. Under Default Value, click Insert Formula Button image.
  5. In the Insert Formula dialog box, click Insert Function.
  6. In the Categories list in the Insert Function dialog box, click Date and Time.
  7. In the Functions list, click today, and then click OK twice to return to the Date Picker Properties dialog box.
    Notice that today() appears in the Value box.
  8. Under Default Value, clear the Update this value when the result of the formula is recalculated check box.
    Note If you clear this check box, the date isn't updated automatically each time a user opens a form based on this form template. This is ideal in situations where you want users to see the date when the form was created. You can leave the check box selected in situations where you have a Last updated on or Last opened on field, where you want the date to change every time the form is opened.
  9. Click OK to return to the form template.
  10. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
  11. Verify that the date that appears in the date picker looks the way that you want it to. If it doesn't, you can change how the date or time is displayed by clicking the Format button in the Date Picker Properties dialog box.

Display the current date and time in a date picker

To automatically insert the current date and time on a form when users open it, you can use the now function with a date picker control.
  1. Insert a date picker on the form template.
  2. Double-click the date picker that you inserted on the form template.
  3. Click the Data tab.
  4. In the Data type box, click Date and Time (dateTime).
  5. Click Format.
  6. In the Date and Time Format dialog box, in the Display the time like this list, click the option that you want, and then click OK.
  7. In the Date Picker Properties dialog box, under Default Value, click Insert Formula Button image.
  8. In the Insert Formula dialog box, click Insert Function.
  9. In the Categories list in the Insert Function dialog box, click Date and Time.
  10. In the Functions list, click now, and then click OK twice to return to the Date Picker Properties dialog box.
    Notice that now() appears in the Value box.
  11. Under Default Value, clear the Update this value when the result of the formula is recalculated check box.
    Note If you clear this check box, the date isn't updated automatically each time a user opens a form based on this form template. This is ideal in situations where you want users to see the date when the form was created. You can leave the check box selected in situations where you have a Last updated on or Last opened on field, where you want the date to change every time the form is opened.
  12. Click OK to return to the form template.
  13. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
  14. Verify that the date that appears in the date picker looks the way that you want it to. If it doesn't, you can change how the date or time is displayed by clicking the Format button in the Date Picker Properties dialog box.

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a date picker:
  • To change the size of several date pickers at once, select the date pickers whose size you want to change, on the Format menu, click Properties, and then on the Size tab, make the necessary adjustments.
  • To change the border or color of a date picker, select the date picker, on the Format menu, click Borders and Shading, and then make the necessary adjustments.
  • To customize the text that appears in a date picker, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the date pickers on your form template at once, right-click the date picker that contains the formatting that you want, and then click Apply Font to All Date Picker Controls on the shortcut menu.
  • To see what your date picker will look like with actual text in it, click Sample Data on the View menu. This helps you get a sense of what the form will look like when users fill it out.
  • On occasion, the text inside a date picker and the label to the left of the date picker may appear to be slightly out of alignment. To quickly realign them, double-click the date picker, click Align on the Size tab, and then click Apply. If the label and date picker 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.
  • To change the way that the date is displayed, double-click the date picker, click the Data tab, and then click the Format button. Choose a display format in the Date Format dialog box.

0 comments |

Use values from a Web service to a list box drop-down list box combo box InfoPath 2007

Author: mety Labels::



You can populate a list box, drop-down list box, or combo box with data from a secondary data connection to a Web service.

A list box, drop-down list box, or combo box displays items that a user can select when filling out a form that is based on your form template. You can configure these types of controls to show the data from a secondary data connection to a Web service. A secondary data connection is any data connection to an external data source that you add to a form template so that users filling out forms based on this form template can get data from or submit data to an external data sources, such as a Web service.
To get data from an external data source, you add a secondary data connection to your form template that queries data. As a result, Microsoft Office InfoPath creates a secondary 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 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 corresponds to the XML Schema (XML Schema: A formal specification, written in XML, that defines the structure of an XML document, including element names and rich data types, which elements can appear in combination, and which attributes are available for each element.) of the Web service. The query data connection gets data from the Web service and stores that data in the secondary data source of the form. By default, the data in the secondary data source is available only while the user is connected to a network. You can configure the secondary data connection to save the results of the query on your users' computers so that they can have access to the data when their forms are not connected to a network.
Security If you are using a secondary data connection to retrieve sensitive data from an external data source, you may want to disable this feature to help protect the data from unauthorized use in case the computer is lost or stolen. If you disable this feature, the data will be available only if the user is connected to the network.
Because the data structure in the secondary data source must match the way that data is stored in the Web service, you cannot modify existing fields or groups in the secondary data source.

Before you begin

Before you can use values from a Web service to populate a control on your form template, you need the following information from the Web service administrator:
  • The location of the Web service.
  • Verification that the Web service uses document/literal style encoding. InfoPath can consume only document/literal style Web services.
  • The name of the Web service operation that will send data to the form.
  • Whether you can safely store the query results from the Web service on the users' computers for offline use.

Step 1: Add a query data connection

If you do not have an existing query data connection in your form template that you can use to supply the values for the control, follow these steps to add a new secondary data connection. If your form template already has a secondary data connection that you can use.
  1. On the Tools menu, click Data Connections.
  2. In the Data Connections dialog box, click Add.
  3. In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next.
  4. On the next page of the wizard, click Web service, and then click Next.
  5. On the next page of the wizard, type the location of the Web service.
    Note If you want to search for a Web service by using a Universal Description Discovery and Integration (UDDI) server, click Search UDDI, enter the URL of the UDDI server that you want to search, specify whether you want to search by provider or by a service that is provided, enter a search keyword, and then click Search. Web services that match your search keyword will appear in the Search result list. Select the Web service that you want to use, and then click OK.
  6. Click Next.
  7. In the Select an operation list, click the Web service operation that returns data to the form, and then click Next.
  8. If the Data Connection Wizard encounters an unknown element in the schema of the Web service, the next page of the wizard may ask you to specify sample values for each parameter to determine what fields or groups to add to the main data source.
    1. Select a parameter in the Parameters table, and then click Set Sample Value.
    2. In the Sample value box, type a value that your user might use for this field, and then click OK.
    3. Repeat these steps for each parameter in the Parameters table, and then click Next.
      When you configure a data connection to a Web service in the Data Connection Wizard, Microsoft Office InfoPath connects to the Web service and requests the Web Service Description Language (WSDL) file. The WSDL file contains the schema used by the Web service. The Web service responds to the request by sending this file to InfoPath. InfoPath uses the information in this file to add the appropriate fields and groups to the secondary data source in the form template. If InfoPath finds an unknown element type in the WSDL file, InfoPath uses sample data to determine the definition of the unknown element type and then adds the appropriate fields and groups to the secondary data source.
  9. If you want the results of the query to be available when the form is not connected to a network, select the Store a copy of the data in the form template check box.
    Security Selecting this check box stores the data on the user's computer when the form uses this data connection. If you are getting sensitive data from this data connection, you may want to disable this feature to help protect the data in case the computer is lost or stolen.
  10. Click Next.
  11. On the next page of the wizard, type a descriptive name for this secondary data connection.
  12. To have the form automatically receive data when it is opened, select the Automatically retrieve data when form is opened check box.

Step 2: Configure the control

  1. If the form template has multiple views, click View name on the View menu to go to the view with the control where you want to display the data from the secondary data source.
  2. Double-click the list box, drop-down list box, or combo box that you want to populate.
  3. Click the Data tab.
  4. Under List box entries, click Look up values from an external data source.
  5. In the Data Source list, click the data source with the group or fields containing the data that you want to use.
  6. Click Select XPath Button image next to the Entries box.
  7. In the Select a Field or Group dialog box, specify what data will be shown to the user and what data will be submitted to the external data source by doing one of the following.
    • Click a field, and then click OK.
    Note In this scenario, the data that the user will see is from one of the fields in the group, and the data that the user will submit is in another field in the same group.
    1. Click a group, and then click OK.
    2. In the Control Properties dialog box, click Select XPath Button image next to the Value box.
    3. In the Select a Field or Group dialog box, click a field that contains the data that the user will submit to the external data source, and then click OK.
    4. In the Control Properties dialog box, click Select XPath Button image next to the Display name box.
    5. In the Select a Field or Group dialog box, click a field that contains the data that will appear in the control, and then click OK.
  8. If the field in the Display name box has values with similar display names and you want to display only unique names, select the Show only entries with unique display names check box.

0 comments |

Insert a multiple-selection list box InfoPath 2007

Author: mety Labels::



A multiple-selection list box is list of choices that looks like a scrollable list of check boxes instead of a typical list box. Users can select as many check boxes as necessary from the list. Depending on how you design the multiple-selection list box, users may also be able to type their own list item next to one of the check boxes.

Use a multiple-selection list box when you want to:

In the following illustration, users can assign expenses in an expense report form to multiple categories by selecting check boxes in a multiple-selection list box. The form designer has chosen to permit custom categories. Consequently, users can enter a value in an empty box next to the last check box in the list.
Custom value being added to list of choices in multiple-selection list box
After you insert a multiple-selection list box on your form template, you must specify the values that you want to appear in it. Otherwise, users will see an empty box when they open a form that is based on your form template. In the Multiple Selection List Box Properties dialog box, you can type the entries yourself or configure the multiple-selection list box to retrieve entries from a database or other data source.

Related controls

Microsoft Office InfoPath includes controls that are similar to multiple-selection list boxes but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list:
List box Like a multiple-selection list box, a standard list box allows users to select values in a list. However, with a list box, users can select only one item in the list. Like a multiple-selection list box, a list box displays all of the items in the list by default.
Drop-down list box Like any other list, a drop-down list box offers users a list of choices. However, with drop-down list boxes, the list entries are hidden until the user clicks the control. Users can select only one item from a drop-down list.
Combo box If you want your users to be able to type their own list entry or choose a value from a predefined list, use a combo box instead of a multiple-selection list box. Users can select only one item from a combo box.
Option buttons Like a multiple-selection list box, a group of option buttons enables users to select from a list of choices. Unlike multiple-selection list boxes, users can select only one option from a group of option buttons. In addition, with option buttons, users click a small circle to make a choice instead of clicking an item in a list box.

The user experience

With multiple-selection list boxes, users make choices by selecting or clearing check boxes in a box on the form. If the number of check boxes exceeds the height of the control, a scroll bar appears on the right side of the box so that users can see the remaining choices.
You can design your form template so that users can type their own entry in the list, if necessary. In this case, a check box with an edit box appears as the last item in the list.
Empty box in multiple-selection list box
To enter a custom value, users select the check box next to the edit box and then type their entry in the area next to the check box. For this to be possible, you must select the Allow users to enter custom values check box in the Multiple-Selection List Box Properties dialog box when you insert the multiple-selection list box onto your form template.

Compatibility considerations

When you design a form template in InfoPath, you can choose to design a browser-compatible form template (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.). When you design a browser-compatible form template, multiple-selection list box controls are unavailable in the Controls task pane because they cannot be displayed in a Web browser.

Insert a multiple-selection list box

The procedure for inserting a multiple-selection list box differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.
The following illustration shows how a multiple-selection list box looks when it is selected in design mode, before the form template designer has manually added the list box entries.
Empty multiple-selection list box selected in design mode
Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.
The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Multiple-selection list boxes are always bound to repeating fields (repeating field: A field in the data source that can occur more than once. Controls such as bulleted, numbered, and plain lists; repeating sections; and repeating tables can be bound to repeating fields.) inside a group (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.). Repeating fields allow you to store more than one value in the field. In the following example, the Category multiple-selection list box on the form template is bound to the category repeating field in the Data Source task pane.
Relationship between mutliple-selection list box on form template and corresponding field in data source
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.
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.

Insert a multiple-selection list box

  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. In the Controls task pane, do one of the following:
    • To automatically create a repeating field in the data source that is bound to the multiple-selection list box, select the Automatically create data source check box.
    • To bind the multiple-selection list box to an existing repeating field, clear the Automatically create data source check box.
      Note If the check box is unavailable, the data source is locked. For example, if you base the design of your form template on an XML Schema, you may not be able to add new fields or groups to the data source in InfoPath. This restriction helps to prevent you from inadvertently making changes to the schema that may render it invalid.
  4. Under Insert controls, click Multiple-Selection List Box.
  5. If you cleared the Automatically create data source check box in step 3, select a repeating field in the Multiple-Selection List Box Binding dialog box to which you want to bind the multiple-selection list box.
  6. On the form template, type the label text above or to the left of the multiple-selection list box, followed by a colon (:).
  7. To specify the values that you want to use as the entries in the list, double-click the multiple-selection list box.
  8. Click the Data tab.
  9. Do one of the following to populate the list box:
    This option is useful when you have a predetermined, limited set of values, and you don't expect those values to change in the future. If the values do happen to change, you must publish an updated version of your form template so that users can see and use the latest list entries.
    1. Click Add.
    2. In the Value box, type the text that you want to store if a user selects this entry.
    3. In the Display name box, type the text that you want to display for this entry, and then click OK.
    4. Repeat steps 1 through 3 for each entry that you want to add to the list box.
    5. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
    This option is useful when you want the values in your list to change, depending on other values that the users enter into their form.
    1. Under List box entries, click Look up values in the form's data source.
      The entries in the list box must be associated with a particular repeating group or repeating field on your form template.
    2. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the repeating field or repeating group that contains the fields that will provide the values for the list box, and then click OK.
    3. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    4. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.
    This option is useful when you want the values in a list box to be up-to-date or refreshed regularly. The values are typically stored in a database or other external data source and are retrieved every time the form is opened.
    1. Click Look up values from an external data source.
    2. Do one of the following:
      • If you already added a data connection, click it in the Data Connection box.
      • To add a new data connection, click Add, and then follow the instructions in the Data Connection Wizard.
        The entries in the list box must be associated with a particular repeating field or repeating group.
    3. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the group or field that contains the fields that will provide the values for the list box, and then click OK.
    4. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    5. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.
  10. If you want users to be able to type their own value at the bottom of the multiple-selection list box, select the Allow users to enter custom values check box.

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a multiple-selection list box:
  • To change the width of several multiple-selection list boxes at once, select the multiple-selection list boxes whose size you want to change, press ALT+ENTER, click the Size tab, and then in the Width box, type a new number.
  • To change the background color for several multiple-selection list boxes at once, select the multiple-selection list boxes that you want to change, on the Format menu, click Borders and Shading, and then on the Shading tab, make the necessary adjustments.
  • To customize the font that appears next to the check boxes in a multiple-selection list box, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the multiple-selection list boxes on your form template at once, click the multiple-selection list box that contains the formatting that you want, and then on the Format menu, click Apply Font to All Multiple-Selection List Box Controls.
  • To adjust the spacing between a multiple-selection list box and the objects that surround it on the form template, experiment with margin settings on the Size tab in the Multiple-Selection List Box Properties dialog box. Using margins to increase the spacing offers a finer degree of control than using paragraph breaks to increase the spacing.

0 comments |

Insert a list box InfoPath 2007

Author: mety Labels::



You can use a list box in a Microsoft Office InfoPath form template to present a list of mutually exclusive choices to a user.

Use a list box when you want to:

In the following illustration, users categorize expenses in an expense report form by selecting values in a list box.
Item selected in list box
After you insert a list box on your form template, you must specify the values that you want to appear in it. Otherwise, users will see an empty list when they open a form that is based on your form template. In the List Box Properties dialog box, you can type the entries yourself or configure the list box to retrieve entries from a database or other data source.

Related controls

InfoPath includes controls that are similar to list boxes but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list:
Drop-down list box Like a list box, a drop-down list box offers users a list of choices. However, in a drop-down list box, the list entries are hidden until the user clicks an arrow next to the list box. If you plan to offer many choices in your list, or if space on your form template is limited, a drop-down list box can be a good choice.
Combo box Like a list box, a combo box offers users a list of choices. However, in a combo box, the list entries are hidden until the user clicks an arrow next to the combo box. Users can type their own entry into a combo box or choose from a list of predefined entries.
Multiple-selection list box If you want users to be able to choose more than one item in a list, you can use a multiple-selection list box instead of a list box. In a multiple-selection list box, users indicate a choice by selecting one or more check boxes instead of clicking a value in a list. As with standard list boxes, the entries in a multiple-selection list box are visible when users first open the form.
Option buttons Like a list box, a group of option buttons enables users to select from a list of mutually exclusive choices. However, with option buttons, users click a small circle to make a choice instead of clicking an item in a list box.

The user experience

List boxes are one of the most commonly used form controls, so most users know how to use them.
To select something from a list box, users simply click the item that they want. The list box is "open," so users can see the list of choices without having to click the control. If the choices in the list exceed the height of the box that contains them, a scroll bar appears on the right side of the control. If users are using the keyboard to fill out the form, they can press the UP ARROW and DOWN ARROW keys to move through the items in the list box.

Insert a list box

The procedure for inserting a list box differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.
The following illustration shows how a list box looks when it is selected in design mode, before a label and entries are added.
List box selected in design mode
Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.
The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. List boxes are always bound to 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.). In the following example, the Category list box on the form template is bound to the category field in the Data Source task pane.
Relationship between list box on form template and corresponding field in data source
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.
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.

Insert a list box

  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. In the Controls task pane, do one of the following:
    • To automatically create a field in the data source that is bound to the list box, select the Automatically create data source check box.
    • To bind the list box to an existing field, clear the Automatically create data source check box.
      Note If the check box is unavailable, the data source is locked. For example, if you base the design of your form template on an XML Schema, you may not be able to add new fields or groups to the data source in InfoPath. This restriction helps to prevent you from inadvertently making changes to the schema that may render it invalid.
  4. Under Insert controls, click List Box.
  5. If you cleared the Automatically create data source check box in step 3, select a field in the List Box Binding dialog box to which you want to bind the list box.
  6. To add a label to the list box, on the form template, type the text above or to the left of the list box, followed by a colon (:).
  7. To specify the values that you want to use as the entries in the list, double-click the list box on your form template.
  8. Click the Data tab.
  9. Do one of the following to populate the list box:
    This option is useful when you have a predetermined, limited set of values, and you don't expect those values to change in the future. If the values do happen to change, you must publish an updated version of your form template so that users can see and use the latest list entries.
    1. Click Add.
    2. In the Value box, type the text that you want to store if a user selects this entry.
    3. In the Display name box, type the text that you want to display for this entry, and then click OK.
    4. Repeat steps 1 through 3 for each entry that you want to add to the list box.
    5. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
    This option is useful when you want the values in your list to change, depending on other values that the users enter into their form.
    1. Under List box entries, click Look up values in the form's data source.
      The entries in the list box must be associated with a particular repeating group or repeating field on your form template.
    2. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the repeating field or repeating group that contains the fields that will provide the values for the list box, and then click OK.
    3. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    4. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.
    This option is useful when you want the values in a list box to be up-to-date or refreshed regularly. The values are typically stored in a database or other external data source and are retrieved every time the form is opened.
    1. Click Look up values from an external data source.
    2. Do one of the following:
      • If you already added a data connection, click it in the Data Connection box.
      • To add a new data connection, click Add, and then follow the instructions in the Data Connection Wizard.
        The entries in the list box must be associated with a particular repeating field or repeating group.
    3. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the group or field that contains the fields that will provide the values for the list box, and then click OK.
    4. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    5. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a list box:
  • Consider widening the list box so that it is a few spaces larger than the average width of the items in the list. That way, the list items aren't partially hidden.
  • To change the width of several list boxes at once, select the list boxes whose size you want to change, press ALT+ENTER, click the Size tab, and then type a new number in the Width box.
  • To change the background color for several list boxes at once, select the list boxes that you want to change. On the Format menu, click Borders and Shading, and then make the necessary adjustments on the Shading tab.
  • To customize the font that appears in a list box, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the list boxes on your form template at once, click the list box that contains the formatting that you want, and then on the Format menu, click Apply Font to All List Box Controls.
  • If you want to adjust the spacing between a list box and the objects that surround it on the form template, you can adjust the margin settings in the List Box Properties dialog box (Size tab). Using margins to increase the spacing offers a finer degree of control than using paragraph breaks to increase the spacing.

0 comments |

Use values from a SQL Server database to a list box drop-down list box combo box InfoPath 2007

Author: mety Labels::



You can populate a list box, drop-down list box, or combo box with data from a query data connection to a Microsoft SQL Server database.

A list box, drop-down list box, or combo box displays items that a user can select when filling out a form that is based on your form template. You can configure these types of controls to show the data from a secondary data connection to a Microsoft SQL Server database. A secondary data connection is any data connection to an external data source that you add to a form template so that users who fill out forms based on this form template can get data from or submit data to an external data source, such as a Web service.
When you add a secondary data connection that queries data to your form template, Microsoft Office InfoPath creates a secondary 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 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 corresponds to the way the data is stored in the database. The query data connection gets data from the Web service and stores that data in the secondary data source of the form. By default, the data in the secondary data source is available only while users are connected to a network. You can configure the secondary data connection to save the results of the query on your users' computers so that they have access to the data when their form is not connected to a network.
Security If you are using a secondary data connection to retrieve sensitive data from an external data source, you may want to disable this feature to help protect the data from unauthorized use in case the computer is lost or stolen. If you disable this feature, the data will be available only if the user is connected to the network.
Because the data structure in the secondary data source must match the way that data is stored in the database, you cannot modify existing fields or groups in the secondary data source.

Before you begin

Before you can use values from a SQL Server database to populate a control on your form template, you need the following information from your database administrator:
  • The name of the server with the database that you will use with this form template.
  • The name of the database that you will use with this form template.
  • The authentication required by the database. The database can use either Microsoft Windows authentication or SQL Server authentication to determine how users can access the database.
  • The name of the table that contains the data that you want to send to the form. This is the primary table. If you plan to use more than one table in the database, you need the names of the other, child tables. You also need the names of the fields in the child tables that have relationships to the fields in the primary table.
  • Whether you can safely store the query results on your users' computers for offline use.

Step 1: Add a query data connection

If you do not have an existing query data connection that you can use on your form template, follow these steps to add a secondary data connection to your form template that queries data. If your form template already has a secondary data connection that you can use.
  1. On the Tools menu, click Data Connections.
  2. In the Data Connections dialog box, click Add.
  3. In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next.
  4. On the next page of the wizard, click Database (Microsoft SQL Server or Microsoft Office Access only), and then click Next.
  5. On the next page of the wizard, click Select Database.
  6. In the Select Data Source dialog box, click New Source.
  7. On the next page of the wizard, in the What kind of data source do you want to connect to list, click Microsoft SQL Server and then click Next.
  8. In the Server name box, type the name of the server that contains the SQL Server database.
  9. Under Log on credentials, do one of the following:
    • If the database determines who has access based on the credentials used in a Microsoft Windows network, click Use Windows Authentication.
    • If the database determines who has access based on a specified user name and password that you get from the database administrator, click Use the following User Name and Password, and then type your user name and password in the User Name and Password boxes.
  10. Click Next.
  11. In the Select the database that contains the data you want list, click the name of the database that you want to use, click Connect to a specific table, click the name of the primary table, and then click Next.
  12. On the next page of the wizard, in the File Name box, type a name for the file that stores the data connection information, and then click Finish to save these settings.
    If you plan to use other tables in the query data connection, you can add the other tables in this page of the wizard.
    1. Click Add Table.
    2. In the Add Table or Query dialog box, click the name of the child table, and then click Next. InfoPath attempts to set the relationships by matching field names in both tables. If you do not want to use the suggested relationship, select the relationship, and then click Remove Relationship. To add a relationship, click Add Relationship. In the Add Relationship dialog box, click the names of the related fields in both columns, and then click OK.
    3. Click Finish.
    4. To add additional child tables, repeat these steps.
  13. Click Next.
  14. To store the results of the query with the form template, select the Store a copy of the data in the form template check box. Selecting this check box stores the query results in the form template. Becuase the data is stored in the form template. the data is available in the forms that users fill out, even if their computers are not connected to a network.
    Security Selecting this check box stores the query results in the form template. Because the data is stored in the form template, it is available in the forms that users fill out, even if their computers are not connected to a network. If you are getting sensitive data from this data connection, you may want to disable this feature to help protect the data in case the computer is lost or stolen.
  15. Click Next.
  16. On the next page of the wizard, type a descriptive name for this secondary data connection. If you want the form to automatically receive data when the form is opened, select the Automatically retrieve data when form is opened check box.

Step 2: Configure the control

  1. If the form template has multiple views, click View name on the View menu to go to the view with the control where you want to display the data from the secondary data source.
  2. Double-click the list box, drop-down list box, or combo box control that you want to populate.
  3. Click the Data tab.
  4. Under List box entries, click Look up values from an external data source.
  5. In the Data Source list, click the data source that you want to use.
  6. Click Select XPath Button image next to the Entries box.
  7. In the Select a Field or Group dialog box, specify what data will be shown to the user and what data will be submitted to the external data source by doing one of the following.
    • Click a field, and then click OK.
    Note In this scenario, the data that the user will see is from one of the fields in the group, and the data that the user will submit is in another field in the same group.
    1. Click a group, and then click OK.
    2. In the Control Properties dialog box, click Select XPath Button image next to the Value box.
    3. In the Select a Field or Group dialog box, click a field that contains the data that the user will submit to the external data source, and then click OK.
    4. In the Control Properties dialog box, click Select XPath Button image next to the Display name box.
    5. In the Select a Field or Group dialog box, click a field that contains the data that will appear in the control, and then click OK.
  8. If the field in the Display name box has values with similar display names, and you want to display only unique names, select the Show only entries with unique display names check box.

0 comments |

Insert a drop-down list box InfoPath 2007

Author: mety Labels::



You can use a drop-down list box in a Microsoft Office InfoPath form template to present a list of mutually exclusive choices to a user. The list is hidden until the user clicks the arrow to the right of the drop-down list.

Use a drop-down list box when you want to:

In the following illustration, users categorize expenses on an expense report form by selecting predefined values in an opened drop-down list box.
Item selected in open drop-down list box
After you insert a drop-down list box on your form template, you must specify the values that you want to appear in it. Otherwise, users will see an empty list when they click the arrow next to the drop-down list box. In the Drop-Down List Box Properties dialog box, you can type the entries yourself or configure the drop-down list box to retrieve entries from a database or other data source.

Related controls

InfoPath includes controls that are similar to drop-down list boxes but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list:
List box Like a drop-down list box, a list box enables users to select a value in a list. However, unlike a drop-down list box, a list box displays the entire list on the form. If space is not an issue on your form template, you might consider using a list box, which may make it easier for users to browse for and select items.
Combo box Like a drop-down list box, a combo box enables users to select a value in a list. The list is hidden until your users choose to display it. However, in a combo box, users can type their own value into the list in addition to choosing from the predefined values.
Multiple-selection list box If you want users to be able to choose more than one item in a list, you can use a multiple-selection list box instead of a drop-down list box. Multiple-selection list boxes take the form of two or more check boxes inside a scrollable list.
Option buttons Like a drop-down list box, a group of option buttons enables users to select from a list of mutually exclusive choices. However, with option buttons, users click a small circle to make a choice instead of clicking an item in a list box.

The user experience

Drop-down boxes are similar in appearance to combo boxes. If you manually type your own list items in the Drop-Down List Box Properties dialog box when you create the drop-down list box, InfoPath displays the text Select as the default entry in the list. This lets users know that they must make a selection from the drop-down list. If the list items come from values elsewhere in the form or from a secondary data source (secondary data source: An XML data file, database, or Web service that is used by a form for the entries in a list box or for script actions.), the Select text is omitted.
When users first open a form, the list items in a drop-down box are hidden. To select an item from the list, users click an arrow on the right side of the drop-down list box and then click the item that they want.

Insert a drop-down list box

The procedure for inserting a drop-down list box differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.
The following illustration shows how a drop-down list box looks when it is selected in design mode.
Drop-down list box selected in design mode
Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.
The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Drop-down list boxes are always bound to fields. In the following example, the Category drop-down list box on the form template is bound to the category field in the Data Source task pane.
Relationship between drop-down list box on form template and corresponding field in data source
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.
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.

Insert a drop-down list box

  1. On the form template, place the cursor where you want to insert the control.
  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
  3. In the Controls task pane, do one of the following:
    • To automatically create a field in the data source that is bound to the list box, select the Automatically create data source check box.
    • To bind the list box to an existing field, clear the Automatically create data source check box.
      Note If the check box is unavailable, the data source is locked. For example, if you base the design of your form template on an XML Schema, you may not be able to add new fields or groups to the data source in InfoPath. This restriction helps to prevent you from inadvertently making changes to the schema that may render it invalid.
  4. Under Insert controls, click Drop-Down List Box.
  5. If you cleared the Automatically create data source check box in step 3, select a field in the Drop-Down List Box Binding dialog box to which you want to bind the list box.
  6. To add a label to the control, type text above or to the left of the control, followed by a colon (:).
  7. To specify the values that you want to use as the entries in the list, double-click the drop-down list box.
  8. Click the Data tab.
  9. Do one of the following to populate the list box:
    This option is useful when you have a predetermined, limited set of values, and you don't expect those values to change in the future. If the values do happen to change, you must publish an updated version of your form template so that users can see and use the latest list entries.
    1. Click Add.
    2. In the Value box, type the text that you want to store if a user selects this entry.
    3. In the Display name box, type the text that you want to display for this entry, and then click OK.
    4. Repeat steps 1 through 3 for each entry that you want to add to the list box.
    5. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
    This option is useful when you want the values in your list to change, depending on other values that the users enter into their form.
    1. Under List box entries, click Look up values in the form's data source.
      The entries in the list box must be associated with a particular repeating group or repeating field on your form template.
    2. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the repeating field or repeating group that contains the fields that will provide the values for the list box, and then click OK.
    3. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    4. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.
    This option is useful when you want the values in a list box to be up-to-date or refreshed regularly. The values are typically stored in a database or other external data source and are retrieved every time the form is opened.
    1. Click Look up values from an external data source.
    2. Do one of the following:
      • If you already added a data connection, click it in the Data Connection box.
      • To add a new data connection, click Add, and then follow the instructions in the Data Connection Wizard.
        The entries in the list box must be associated with a particular repeating field or repeating group.
    3. Click Select XPath Button image next to the Entries box, and then in the Select a Field or Group dialog box, click the group or field that contains the fields that will provide the values for the list box, and then click OK.
    4. Click Select XPath Button image next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.
    5. Click Select XPath Button image next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.
      Tip To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a drop-down list box:
  • Consider widening the drop-down list box so that it is a few spaces larger than the average width of the items in the list. That way, the list items aren't partially hidden.
  • To change the width of several drop-down list boxes at once, select the drop-down list boxes whose size you want to change, press ALT+ENTER, click the Size tab, and then in the Width box, type a new number.
  • To change the background color for several drop-down list boxes at once, select the drop-down list boxes that you want to change. On the Format menu, click Borders and Shading, and then make the necessary adjustments on the Shading tab.
  • To customize the font that appears in a drop-down list box, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the drop-down list boxes on your form template at once, click the drop-down list box that contains the formatting that you want, and then on the Format menu, click Apply Font to All Drop-Down List Box Controls.
  • If you want to adjust the spacing between a drop-down list box and the objects that surround it on the form template, you can adjust the margin settings in the Drop-Down List Box Properties dialog box (Size tab). Using margins to increase the spacing offers a finer degree of control than using paragraph breaks to increase the spacing.

0 comments |

Labels

Blog Archive

Powered by Blogger.

I made these pages for me and my friends to help solving the problem we face regarding Computer & internet, if anyone wants me to answer a question or find out about some information please send me email and I will try to reply.*P.S. some of the article I wrote and the other I found on the internet I posted them in sprit of learning and shearing, please forgive me if you found something you don’t want to be in my blog, email me and I will delete them. Thank you for your interest in my pages.امل نجم Amal Nagm

banner 1 banner 2