Field formatting

Applying a format to a field changes the way in which the data stored in the field is displayed. For example, the phone number field may contain the value 7015551234. By applying a format that adds parentheses around the first three digits and adds a dash between the sixth and seventh digits, the value will be readily recognizable as the telephone number (701) 555-1234.

Formats

You can apply formats created with the Format Definition window to string, currency, composite and numeric fields that appear in the report layout. To apply a format to a field, click the Format lookup button in the Report Field Options window to display a list of formats that can be applied to the field. Select a format in this list, or click New to create a new format. When you have finished, the name of the format applied will appear in the Format field in the Report Field Options window.

Multiple format selector

For fields with the currency or string data types, you can use the Multiple Format Selector to format the data in the field. The Multiple Format Selector is described in Formats. Just as the Multiple Format Selector allows you to use a format field so specify the format to apply to a currency or string field at runtime, you can use the same format field to apply the selected format when the field is printed on a report.

For example, the Multiple Format Selector is used for the Account Number field shown in the following illustration. It allows the user to specify the format to apply to the Account Number field. In this example, the user chose to display the Account Number with dashes.

[spacer]

Both the Account Number field and the Format field are stored for each record in the table, allowing a user to specify which format to use for each record. When the Account Number field is printed on a report, you will want to use the same format that was used when the record was saved. The Format Field in the Report Field options window is used to specify the format field to use.

Don’t use the Format field in the Report Field Options window to apply a format to a report field and use the Multiple Format Selector for the same field; the format results will be unpredictable.


For string fields, the value of the format field indicates which format string will be applied. For currency fields, the value of the format field indicates which predefined currency format will be used. The following table shows Dexterity’s predefined currency formats and the integer value associated with them.

[spacer]

Integer

Format

Integer

Format

0

Control Panel Defaults

10

$1,234.567

1

1,234

11

$1,234.5678

2

1,234.5

12

$1,234.56789

3

1,234.56

13

1,234%

4

1,234.567

14

1,234.5%

5

1,234.5678

15

1,234.56%

6

1,234.56789

16

1,234.567%

7

$1,234.

17

1,234.5678%

8

$1,234.5

18

1,234.56789%

9

$1,234.56

 

 


In addition, the following predefined formats and associated integer values are available for variable currency fields:

[spacer]

Integer

Format

Integer

Format

Integer

Format

100

1

200

$1

300

1%

101

1.1

201

$1.1

301

1.1%

102

1.12

202

$1.12

302

1.12%

103

1.123

203

$1.123

303

1.123%

104

1.1234

204

$1.1234

304

1.1234%

105

1.12345

205

$1.12345

305

1.12345%

106

1.123456

206

$1.123456

306

1.123456%

107

1.1234567

207

$1.1234567

307

1.1234567%

108

1.12345678

208

$1.12345678

308

1.12345678%

109

1.123456789

209

$1.123456789

309

1.123456789%

110

1.1234567890

210

$1.1234567890

310

1.1234567890%

111

1.12345678901

211

$1.12345678901

311

1.12345678901%

112

1.123456789012

212

$1.123456789012

312

1.123456789012%

113

1.1234567890123

213

$1.1234567890123

313

1.1234567890123%

114

1.12345678901234

214

$1.12345678901234

314

1.12345678901234%

115

1.123456789012345

215

$1.123456789012345

315

1.123456789012345%


You can use the functions in the Currency function library to define additional currency formats that can be applied at runtime. Refer to the Currency function library for more information.


The format field must be an integer field. In Dexterity applications, it is common to use a drop-down list for this purpose.


Documentation Feedback