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).
- Global formats can be used by field definitions in any structure and by templates. You can define a maximum of 9,999 global field formats.
- Structure-specific formats are defined for a particular structure, and only the fields in that structure can use them. You can define a maximum of 250 structure-specific field formats in each structure.
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.)
|
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, |
- To define a format from scratch, select Format Functions > Add Format.
- To define a format by copying, highlight the format you want to copy, and then select Format Functions > Copy Format.
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. | 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.
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. |
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. |