You are here: Function Reference > Alphabetical Listing > S > SpanField

SpanField

Use this function/procedure to move a field horizontally and then resize it to span the distance between two other fields you specify. This function sets the span field’s contents to be enough of a fill character to span the distance.

This function only moves the field horizontally. It will not move the other two fields. The section designer must ensure vertical alignment between the fields.

Syntax

SpanField (SpanField, LeftField, RightField, Section, Form, Group)

Parameter

Description

SpanField

Use this parameter to specify the filler character you want the system to use to span the distance between the end of the left field text and the beginning of the right field text. If either field is empty, the left coordinate of the field is used.

The system only uses the first character of the text contained in the field you specify as the filler character.

In addition to the filler character, the field you specify also determines the font ID to be used for calculating the number of characters required to fill the width of the field.

If there is fractional space remaining in the width, the filler character is duplicated. The extra white space will be placed to the left of the span field, so that the spanned field will is placed against the right-most field.

The default is a period (.).

LeftField

Enter the name of the field on the left of the area you want to span.

RightField

Enter the name of the field to the right of the area you want to span.

Section

(Optional) Enter the name of a section that contains the fields you specified. The default is the current section.

Form

(Optional) Enter the name of a form that contains the section and/or field you specified. The default is the current form.

Group

(Optional) Enter the name of the form group that contains the form, section, or fields you specified. The default is the current group.

The SpanField parameter is always the first parameter, but you can specify the LeftField and RightField parameters in any order. The system automatically determines which of the two fields is to the right or left of the span field.

Note If you are using the SpanField function in Documaker Server processing, the JustFld rule may be useful to right justify the right-most field to make sure the maximum distance is spanned. If you use the Move_It rule, or other rules that support right justification by padding the data with spaces, the results will be incorrect. The SpanField function calculates the width of a field based upon the entire contents and does not remove space, or any other white space or characters in the fields.

Example

Here is an example:

Assume LeftField contains ABCDEFG, RightField contains $123.45, and SpanField contains a dash ( - ).

SpanField("SPANFIELD", "LEFTFIELD", "RIGHTFIELD")

Yields: ABCDEFG-----------$123.45

The horizontal location of the span field is adjusted to make sure it is positioned against the right edge of the left field, and then expanded with enough of the fill character to fill the gap between the left and right fields. The section designer is responsible for vertical alignment.

See also