List Items Property Page |
The List Items property page is available for radio button, list box, and dropdown list controls. It defines the Display Text (label) that a user sees on the data entry form and the Item Value for each label, which is what prints on an item.
The Item Value that prints on an item can be the same as the Display Text, or it can be a different value that is either defined by you on the property page or specified by the Source property that you select to populate the lists.
The following sources are available:
The Embedded Data source lets you manually enter the values you want to appear in the list. To enter a new value in the list, click on a blank row and type the value you want. To delete a value, click on the row for the value you want to delete and press the Delete key on your keyboard.
The lists can be sorted in either ascending or descending order, based on either the Display Text or the Item Value lists. Simply click on the column header of the list you want to sort by.
The following option is available when you select Embedded Data as the source:
Use display text for item value: When enabled, the value that you specify as the Display Text for each available selection in the list will also be the value that prints on your item. If you disable this option, you can type a different value to appear on your printed item.
The Database source pulls the list items from a connected database, such as a text file, Microsoft Excel spreadsheet, or other data file.
|
The database connection for the list items is completely independent of the database connection that populates data on your template. Even if you have already connected to a database in your document, you need to rerun the Database Setup Wizard to connect to a new database (or the same one). |
The following options are available when you select Database as the source:
Source: Selecting Database populates the lists with values from a database that you connect to by using the Database Setup dialog.
Database Setup: Opens the Database Setup dialog, where you can connect to the database that you want to use to populate the lists.
Use display text for item value: When this option is enabled, the value that you specify as the Display Text for each available selection in the list will also be the value that prints on your item. If you disable this option, you can specify that the Item Value is populated by a different field from the database, so that a different value prints on your item.
Display Text Field: Specifies the database field that populates the Display Text list (and the Item Value list when Use display text for item value is disabled).
Item Value Field: Specifies the database field that populates the Item Value list. Available when Use display text for item value is disabled.
Sort items: Sorts the lists in ascending order based on the values included for the Display Text. The order displayed on the property page is the order that will be displayed on the data entry form.
The External File source pulls the list items from a file somewhere on your computer.
The following options are available when you select External File as the source:
File Name: Specifies the file that you have selected to populate the lists. Click Select File to browse to the file that you want to select.
Encoding: Specifies the encoding you want to use with the selected file.
Sort items: Sorts the lists in ascending order based on the values included for the Display Text. The order displayed on the property page is the order that will be displayed on the data entry form.
The File Names in Folder source populates the list items with file names from a specified directory on your computer or network. Once you have specified a folder, you can filter the list to include only files of a certain type that are within the specified folder. For instance, in a folder with many different types of files, typing *.xlsx for the File Pattern would allow you to populate the list with only the file names for the Excel files in the specified directory.
The following options are available when you select File Names in Folder as the source:
Folder: Specifies the folder that you have selected to populate the lists. Click Select to browse to the folder that you want to select.
File Pattern: Enables you to filter the lists to only files of a certain type that are within the specified folder. For instance, in a folder with many different types of files, typing *.xlsx for the File Pattern would allow you to populate the list with only the file names for the Excel files in the folder.
Show file extension: When this option is enabled, the file name extension is included with the file names in both the Display Text and Item Value lists.
Use full path for item value: When this option is enabled, the Item Values list includes the full path (including file name extension) for each file included in the list.
The Visual Basic Script source lets you write a custom VBScript to populate the list items. A carriage return (vbCr) should be used to separate multiple list items. The Script Editor, accessible from the Edit Script button, is used to write and modify your script.
When writing your script, each Display Text and Item Value pair in the list is separated from the next by using a carriage return (vbCr). Within each pair, the Display Text and Item Value are separated by using a tab character (vbTab).
In the following example, you are selling three products: an orange costing $0.50, a banana costing $0.65, and a muffin costing $1.00. You want the data entry form to display three radio buttons, one for an orange, one for a banana, and one for a muffin. On the printed items, you want to print only the price. To populate the radio button list, you would type the following VBScript in the Script Editor:
Value = "Orange" + vbTab + "0.5" + vbCr + "Banana" + vbTab + "0.65" + vbCr + "Muffin" + vbTab + "1"
This will populate the list control as follows:
Display Text |
Item Value |
---|---|
Orange |
0.5 |
Banana |
0.65 |
Muffin |
1 |
If you want the Display Text and Item Value to be the same, you can type the same value for each pair or simply not include the Item Value definition, as follows:
Value = "Orange" + vbTab + "Orange" + vbCr + "Banana" + vbTab + "Banana" + vbCr + "Muffin" + vbTab + "Muffin"
OR
Value = "Orange" + vbCr + "Banana" + vbCr + "Muffin"
Either of these scripts will populate the list control as follows:
Display Text |
Item Value |
---|---|
Orange |
Orange |
Banana |
Banana |
Muffin |
Muffin |
When you have a query prompt linked to the data entry control, the Query Prompt Values source populates the list items based on the records that match the query prompt. A query prompt is set up in the Filter view of the Database Setup dialog.
This property page is available for the following controls:
Related Topics