Defining field formats

You can define field formats and then select them in the Format name field on the Display tab when defining a field or template. (The information on this tab defines how you want the field to display in Toolkit or ReportWriter; see Display information.) For example, you might want to define a format for a date or customer ID.

Repository has two types of field formats: global and structure-specific (or local).

Displaying the Format Definitions list

To display the Format Definitions list for global formats, select Modify > Formats from the main Repository window.

To display the Format Definitions list for a structure-specific format, do the following:

1. Highlight the structure in the Structure Definitions list.
2. Select Structure Functions > Edit Attributes.
3. Select Attributes > Formats.

The Format Definitions list displays the format name, type (A for alpha; N for numeric), and the actual format string. The total number of global formats or structure-specific formats is displayed at the bottom of the list. (See figure 1.)

1. The Format Definitions list.

Defining a new format

You can define a new format from scratch or by copying and modifying an existing one. The process is the same whether you are creating a global format or a structure-specific format.

1. From the Format Definitions list,

The Format Definition input window is displayed. The example in figure 2 shows a display format for telephone numbers, with the area code enclosed in parentheses and the prefix separated from the last four digits by a hyphen.

2. Defining a format.

2. Enter or modify data in each field as instructed below.

Format name

Enter a format name. This name identifies the format when it’s assigned to a field or template. For a global format, the name must be unique among all formats, while for a a structure-specific format, the name must be unique within the structure. The format name can have a maximum of 30 characters and must begin with a letter. The remaining characters can be letters, digits, underscores (_), or dollar signs ($).

Format type

Select the format type: Alpha or Numeric.

Format string

Enter a format string with a maximum of 30 characters. For an alpha format, enter “at” signs (@). Each @ stands for an alphanumeric character. For a numeric format, enter the correct Synergy DBL data formatting character as shown in Appendix D: Repository Data Formats. For both alpha and numeric formats, you can also enter formatting characters (such as dashes, backslashes, and so forth) wherever you want them.

Justification

Select how you want the format justified. The default justification is None. The format justification defines how a format is truncated before being applied to a field in ReportWriter.

For example, if the numeric format is

$$$,$$$,$$$.XX-

and you want to use that format with a d10.2, a d8.2, and d2.2 field, a right-justified format for the d8.2 field would look like this:

$,$$$,$$$.XX-

and a right-justified format for the d2.2 field would look like this:

$$$.XX-

3. Exit the window to save your changes.

Reordering structure-specific formats

1. Highlight the structure-specific format you want to move.
2. Select Format Functions > Reorder Formats. The highlighted format is enclosed in square brackets ([ ]).
3. Use the Up and Down Arrow keys to move the bracketed format to another location in the list.
4. Select Reorder Formats again to exit move mode. The format is inserted at the new location.

Modifying a format

1. In the Format Definitions list, highlight the format you want to modify and press Enter.
2. In the Format Definition window, modify data as necessary. See step 2 for detailed information on the fields. The format name cannot be modified.
Note

Modifying a format affects any fields selected for printing in existing ReportWriter reports, provided you have not overridden the format in ReportWriter.

3. Exit the window to save your changes.

Deleting a format

You cannot delete a structure-specific format that is used by a field in the current structure.

Repository does not maintain a list of the fields and templates that use a global format, so it is possible to delete one that is in use, but we do not recommend this. If ReportWriter tries to display a field whose format no longer exists, that field is displayed unformatted.

1. In the Format Definitions list, highlight the format you want to delete.
2. Select Format Functions > Delete Format.
3. At the prompt, select Yes to delete the format or No to cancel the deletion.