Altair® Monarch®

 

Moving a Field Definition

From time to time the layout of a report may be modified in such a way that the field definitions in your model file no longer line up with the data in the report. A new field may have been added to the report definition or existing fields may have been adjusted left or right. When you apply a model file created for a previous instance of the report to the new report, the model file's field definitions may extract the wrong data. In this case you may either create a new model file for the new report format or make a copy of the existing model file and adjust the field definitions in the copy to match the new report format. The latter method may save considerable time since you won't need to rebuild the entire model file from scratch, especially if your model contains filter, sort, calculated field or summary definitions.

Note:

Monarch Classic Version 8 introduced the shift templates/traps feature, which greatly simplifies the process of shifting templates and traps within a model to accommodate changes in a report. We recommend you try using this feature before resorting to any of the following methods.

Making a copy of the model file

Steps:

  1. Make a copy of the model file and then load the copy along with an instance of the report that represents the new report layout.

  2. Open the new report.

  3. Open the new copy of the model file.

Once you have created a copy of your model file and opened it along with an instance of the new report, you need to make the necessary adjustments to match the new report format. Monarch Classic provides two methods that you can use to make these adjustments.

The Template Editor provides a visual interface that you can use to adjust fields in a model and add new fields to a model. Use this dialog if your adjustments require addition of new fields or removal of existing fields.

The Field List window displays the properties for all fields in a single list, including each field’s starting template line and column and template width. Use this dialog if your adjustments are limited to shifting fields up, down, left, or right within a template or for changing the width of a field.

Using the Template Editor to adjust field definitions for a new report layout

Steps:

  1. Go to Report Design.

  2. On the Report Design interface, select the template you wish to edit on the Templates selector.

  3. Click on a field and then select Edit Field on the Template Editor action bar. Or, right-click on the field and then select Edit Field on the context menu. The Field Properties window displays.

  4. Select the name then press CTRL+C to copy the field name to the Clipboard.

  5. Click Cancel to remove the Field Properties window .

  6. Click the Delete Field button or press the Delete key to remove the existing field definition.

  7. Use the mouse or the keyboard to highlight the field in its new position.

  8. Using the mouse:  Click down in the Sample box at the left extent of the field, then drag right to highlight the field.

    Using the keyboard:  The keyboard provides a more precise method of highlighting fields, since you can easily adjust the field width by a single character at a time. Press ALT+S to shift the focus to the Sample box. Use the arrow keys to move the cursor to the first character in the field, then press Insert and use the right arrow to highlight the field. Press Enter to complete the field definition.

  9. Position your cursor on the Field Properties panel.

  10. Press CTRL+V to paste the original field name into the Name box.

  11. Click the check icon to accept the name.

  12. Repeat steps 3 - 10 to adjust other fields in the template.

  13. Commit the edits by doing one of the following:

  14. Repeat steps 2 - 12 to adjust fields in other templates.

Using the Field List dialog to adjust field definitions for a new report layout

Steps:

  1. Go to Table Design.

  2. The Field List window displays.

  3. Ensure that the Show Template Properties option is selected (checked).

  4. Click on the Source Column title. This sorts the fields by template name so that all fields from the each template are displayed together.

  5. Identify the fields that you need to adjust.

  6. Adjust each field’s Line, Column, and Template Width properties as needed.

Note:

When adjusting these properties, be aware of the potential for creating overlapping field boundaries. For example, suppose your old reports included a date field in the form 09/24/01, positioned on line 1, column 3. This field would require a template width of 8 characters. If the new report format modifies this field to include 4 digits for the year, the field’s template width will need to be increased to 10 characters. If increasing the template width would cause the field to bump into a field to its right, Monarch Classic will report an error and prevent you from increasing the template width. In this case, you must first move the field on the right out of the way, then increase the template width of the field on the left. This situation can occur under a number of other circumstances, all of which Monarch Classic will catch and inform you of.

To avoid these errors, you should always move fields in reverse order when shifting fields to the right (i.e., shift the rightmost field first and then work backwards to the leftmost field). The same rule applies when increasing a field’s width and this rule applies in reverse when shifting fields to the left (i.e., shift the leftmost field first, then each successive field).