About display formats

You can use display formats to customize the display of column data in a DataWindow object. Display formats are masks in which certain characters have special significance. For example, you can display currency values preceded by a dollar sign, show dates with month names spelled out, and use a special color for negative numbers. You can use the many predefined display formats provided with PocketBuilder or define your own.

The DataWindow object in Figure 21-1 uses no display formats; all values display as they are stored in the database.

Figure 21-1: DataWindow object without display formats

The sample shows five columns of data without display formats applied. For example, phone numbers have no parentheses around the area code, and salaries are displayed without dollar signs.

Figure 21-2 shows the same DataWindow object with display formats for the Phone, Salary, and Start Date columns, that make the data easier to interpret.

Figure 21-2: DataWindow object with display formats

The sample shows five columns of data with display formats applied. Phone numbers have parentheses around the area code, for example, and salaries are displayed with dollar signs. In the start date column, the names of months have replaced numbers.

NoteDisplay formats not used for data entry When users tab to a column containing a display format, PocketBuilder removes the display format and displays the raw value for users to edit.

If you want to provide formatting that is displayed during data entry, you need to specify edit masks, as described in “The EditMask edit style”.

About display format masks and EditMasks

The differences between display format masks and EditMask edit styles can be hard to understand. A display format mask determines the appearance of the column when the focus is off the column, or when the DataWindow object is in print preview mode. When you apply an EditMask edit style, the mask you use determines the appearance of the column when focus is on the column.

If you want data to display differently depending on whether the focus is on or off the column, specify an edit mask (on the Edit properties page for the column) as well a display format (on the Format properties page for the column), then check the Use Format check box on the Format properties page. The Use Format check box displays only when an edit mask has been specified.