Dimensions and Formatting

On this page

Unit of Measurement

Dimensional Attributes

Alignment Attributes

Inactive and Invisible

Formatting Attributes

Dimensions are specifications. Dimensions in TDL are effective either in Display mode or in Print mode. Data in TDL does not have an absolute position of the dimensions specified, but relative. There are four definitions in TDL that attract dimensions. They are Form , Part , Line and Field .

Unit of Measurement

A Unit of Measurement can be any of the following:

Millimeters/mms

Centimeters/cms

Inch(es)

Number of Characters/Number of Lines

% Screen/Page

Number – Points (where 1 Point = 1/72 Inch)

Dimensional Attributes

Dimensional attributes can be classified into two, i . e., Specific and General Attributes.

D e finitions

S pecific Dimensions

General Dimensions

Form

Height, Width, Space Top, Space Bottom, Space Left, Space Right

Horizontal Align, Vertical Align, Full Height, Full Width

Part

Height, Width, Space Top, Space Bottom, Space Left, Space Right

Horizontal Align, Top Parts,Bottom Parts, Left Parts, Right Parts

Line

Height, Space Top, Space Bottom, Indent

Full Height, Top Line, Bottom Line

Field

Width, Space Left, Space Right, Indent

Full Width, Left Field, Right Field, Widespaced

The various dimensional attri b utes are as s h own in the given table.

Sizing/Size Attributes

Height and Width

The attribute Height is used to specify the height required for the Form , Part and Line definitions, whereas the attribute Width is used to specify the width required for the Form , Part and Field definitions. The Height and Width can be specified in terms of any of the above Units of Measurement. In the absence of any Unit of Measurement, the height assumes a certain number of lines and similarly, the Width assumes number of characters. The entire height and width is in the proportion of the available paper/screen dimensions.

Syntax

Height : <Measurement Formula>

Width : <Measurement Formula>

Height and Width – Form Definition

The Height and Width, when specified in a Form definition, implies that it is the available height and width which can be utilized by all the Parts, Lines and Fields within the Form. If the contents of the Part and Line exceed the available Height and/or Width, the contents of the Form are squeezed to accommodate the same within the available Height and Width. In the absence of any Height and Width specified, the Form Definition assumes the Height and Width required by the contents of the Form, comprising of Parts, Lines and Fields.

Example :

Height : 10 inch

Width  : 8.50 inch

Height and Width – Part Definition

Subsequently, Height and Width, when specified in a Part Definition, implies that it is the available Height and Width that can be utilized by all its Sub-Parts, Lines and Fields. If the contents of the Sub-Parts, Lines and Fields exceed the available Height and Width, the contents of the Part are squeezed to accommodate the same within the available Height and Width.

Example:

Height : 10% Page

Width  : 60% Page

Height – Line Definition

Similarly, the Height, when specified within a Line definition, restricts the contents of the Lines to the available line height. Generally, specifying the Line Height is not required since the contents of the lines are controlled by the given Part Height.

Width – Field Definition

The Width, when specified within a Field definition, limits the contents of the Field within the defined boundary. If the contents are longer than the available Width, the Field contents are squeezed to accommodate the same within the defined width.

FullHeight and FullWidth

The attribute FullHeight can be specified in a Form or a Line Definition, and the Attribute FullWidth can be specified in a Form or a Field Definition. FullHeight is used to instruct the Form or the Line to utilize the full Height, while FullWidth is used to instruct the Form or the Field to utilize the full Width.

Syntax

FullHeight : <Logical Value>

FullWidth : <Logical Value>

Example:

FullHeight: No

FullWidth : No

FullHeight and FullWidth – Form Definition

The attribute FullHeight decides whether to allow the form to consume the full Height or not, depending on the logical value set. By default, the value set for this attribute is YES. If the current Form uses Bottom Parts or Bottom Lines, then the Height required/utilized by the Form will be 100% Page/Screen.

Similarly, the attribute FullWidth decides whether to allow the Form to consume the full Width or not, depending on the logical value set. By default, the value set for this attribute is YES. If the current Form uses the Right Par t s or Right Lines, then the Wi d th required/utilized by the Form will be 100% Page/Screen.

FullHeight – Line Definition

The attribute FullHeight decides whether the line can consume the full available Height or not, depending on the logical value set. By default, the value set to this attribute is YES.

FullWidth – Field Definition

The attribute FullWidth decides whether the Field can consume the full available Width or not, depending on the logical value set. By default, the value set to this attribute is YES.

Spacing/Position Attributes

Space Top, Space Bottom, Space Left and Space Right

Attributes Space Top, Space Bottom, Space Left and Space Right are used to specify the spaces to be kept to the Top, Bottom, Left and Right of the definition. Space Top and Space Bottom can be used in Form, Part and Line Definitions. Space Left and Space Right can be used in Form, Part and Field Definitions.

When Space Top, Space Bottom, Space Left and Space Right are used in a definition, these spaces are included in the Height and Width specified within the definition.

Syntax

Space Top        : <Measurement Formula>

Space Bottom : <Measurement Formula>

Space Left        : <Measurement Formula>

Space Right     : <Measurement Formula>

Example

Space Top     : 1.5 inch

Space Bottom  : If ($$IsStockJrnl:##SVVoucherType OR $$IsPhysStock:##SVVoucherType) then 0 else 0.25

Space Left    : @@DSPCondQtySL + @@DSPCondRateSL + @@DSPCondAmtSL

Space Right   : 1

Space Top, Space Bottom, Space Left and Space Right – Form/Part Definition

The attributes Space Top, Space Bottom, Space Left and Space Right are specified in a Form or a Part Definition, by leaving the appropriate spaces before displaying/printing a Form. These spaces are included in the Height/Width of the Form Definition.

Space Top and Space Bottom – Line Definition

The attributes Space Top and Space Bottom, when specified in a Line Definition, leave the appropriate spaces before/after the Line. These spaces are inclusive within the Height of the specific Part in which the current Line Definition resides. If the Height of the Part is unable to accommodate the same, it compresses the line to fit it within the available Height.

Space Left and Space Right – Field Definition

The attributes Space Left and Space Right, when specified in a Field Definition, leave the appropriate spaces before/after the Field. These spaces are inclusive within the Width of the Part and Field. If the Width of the Part is unable to accommodate the same, it compresses the Fields within the Parts and Lines, to fit it within the available Width.

Indent

An Indent can be specified either in a Line or a Field definition. It is similar to the Tab Key which is used to specify a starting point for a Line or a Field.

Syntax

Indent : <Measurement Formula>

Example:

Indent : @@IndentByLevel

Indent – Line Definition

This attribute in the Line Definition specifies the space to be left from the Left margin before the contents of the line begin.

Indent – Field Definition

This attribute in the Field definition is similar to the Space Left attribute, except that it indents the field independent of width of the field. Space Left indents the field within the width available. However, Indent indents the field exclusive of the width. It can either take a formula as a parameter, or the expression itself. The formula can decide as to what extent each instance of the field has to be indented from the initial place. This attribute is typically used while displaying reports like List of Accounts, Trial Balance, etc., where the groups and ledgers under a particular group are recursively indented inside the group, based on the order of the groups and ledgers.

Alignment Attributes

Top Parts, Bottom Parts, Left Parts and Right Parts

These attributes are used to place different parts at different positions in a particular Form or Part. The attributes Top Parts and Bottom Parts can be specified in Form as well as Part Definitions, whereas attributes Left Parts and Right Parts can be specified only in the Part Definition.

Syntax

Top Parts      : <Part1, Part2, ….>

Bottom Parts : <Part1, Part2, ….>

Left Parts     : <Part1, Part2, ….>

;; Only for Part Definition

Right Parts    : <Part1, P a rt2, ….>

;; Only for Part Definition

Example:

Top Parts    : ACLSFixedLed, TDSAutoDetails

Bottom Parts : PJR Sign

Left Parts   : EXPINV Declaration

;; Attribute Left Parts can be used only for Part Definition

Right Parts  : STKVCH Address

;; Attribute Right Parts can be used only for Part Definition

Top Parts and Bottom Parts – Form Definition

In cases where the Top Part or Bottom Part is specified within a Form Definition, it occupies the Top Section or Bottom Section of the Form respectively, keeping in account the Space Top and Space Bottom of the Form. The attribute Space Bottom impacts the Bottom Parts by moving them from the bottom, in order to leave appropriate spaces. Similarly, Space Top impacts the Top Parts by moving them from the top, in order to leave appropriate spaces. The Bottom Parts/Bottom Lines start printing from bottom to the top of the Form. If Height is specified at the Form Definition, then the Bottom Parts/Lines start printing from the bottommost line within the specified Height.

Top Parts, Bottom Parts, Left Parts and Right Parts – Part Definition

In cases where the Left Part or Right Part is specified within a Part Definition, it occupies the Left Section or Right Section of the Part respectively, keeping in view the Space Left and Space Right of the Part. The attribute Space Right impacts the Right Parts by moving them from Right, in order to leave appropriate spaces. Similarly, Space Left impacts the Left Parts by moving them from

Left, in order to leave appropriate spaces. If the intent is to have multiple parts printed horizontally, then the Part Attribute Vertical should be set to NO. In cases where the Vertical Attribute is set to YES, all the parts within this part will be printed vertically. In such cases, the Left Parts will position at the Top of the Screen/Page and the Right Parts at the Bottom of the Screen/Page.

In cases where the Top Part or Bottom Part is specified within a Part Definition, it occupies the Top Section or Bottom Section of the Part respectively, keeping Space Top and Space Bottom of the Part in account. The attribute Space Bottom impacts the Bottom Parts by moving them from the bottom in order to leave appropriate space. Similarly, the attribute Space Top impacts the Top Parts by moving them from the Top in order to leave appropriate spaces. If the intent is to have multiple parts printed vertically, then the Part Attribute Vertical should be set to Yes. If the Vertical Attribute is set to No, then all the parts within this part will be printed horizontally. In such circumstances, the Top Parts will be positioned at the Left of the Screen/Page while the Bottom Parts are positioned at the Right of the Screen/Page.

Note: Both Parts and Lines are not allowed together within a Part. They are mutually exclusive entities. Either Parts or Lines can be specified at a time, within a Part.

Top Lines and Bottom Lines

These attributes are used to place different lines at different positions in a particular Part Definition. The attributes Top Lines and Bottom Lines can be specified in a Part Definition. However, the attributes Top Lines/Lines can only be used in a Line and Field Definition.

Syntax

Top Lines    : <Line1, Line2,…..>

Bottom Lines : <Line1, Line2,…..>

Example:

Top Lines    : Form SubTitle, CMP Action

Bottom Lines : VCHTAXBILL Total

Top Lines and Bottom Lines – Part Definition

Attribute Top Lines is used to place lines at the top, while attribute Bottom Lines is used to place lines at the bottom of the Part, with respect to the Height specified within the Part definition.

Left Field and Right Field

The attribute Left Fields can be specified in both Line and Field Definition whereas the attribute Right Fields can only be specified in a Line Definition.

Syntax

Left Fields   : <Field1, Field2, ….>

Right Fields : <Field1, Field2, ….>

Example:

Left Fields  : Medium Prompt, Chg SVDate, Chg VchDate

Right Fields : Trader TypeofPurchase, Trader QtyUtilisedTotal

Left Fields and Right Fields – Line Definition

The attribute Left Fields and Right Fields specified in a Line Definition, places the fields at their respective position. Left Fields starts printing from the Left to the Right of the Line, while Right Fields starts printing from the Right to the Left of the Line. If Repeat Attribute is used in a Line, specification of Right Fields is not allowed, as by default, the Repeat Attribute places the Field specified to the Right of the Screen/Page.

Left Fields/Fields – Field Definition

The attribute Field is used to create fields containing one or more fields, like Group fields. We can create multiple fields inside a single field, using the Fields attribute. The attribute Fields is useful when multiple Fields are required to be repeated in a Line. For example, in case of a Trial Balance, two Fields, i.e., Debits and Credits, are required to be repeated together if a new column is added by a user. The new column thus added, should again contain both these fields, i.e., Debit and Credit. In a Line Definition, only one Field can be repeated. So, a Field is required within a Field if more than one field requires to be repeated.

Align

The attribute Align aligns the contents of a Field as specified. The permissible values for this attribute are Left, Center, Right, Justified and Prompt.

Syntax

Align : <String Value>

Example:

Align : Right

Horizontal Align and Vertical Align

Horizontal Align sets the alignment of the Form or Part horizontally while Vertical align sets the alignment of the Form vertically.

Syntax

Horizontal Align : <Logical Value>

Vertical Align    : <Logical Value>

Example

Horizontal Align : Right

Vertical Align   : Bottom

;; Only for Form Definition

The alignment of the Form or Part across the width of the page is set by the attribute Horizontal Align. The default alignment of the Form and Part is in the Centre of the screen, and on the Left on printing. Depending on the width of the Form and page, the Form or Part will be displayed or printed, leaving equal amount of space on the left and right of the Form.

The alignment of the Form across the height of the page is set by the attribute Vertical Align. The default alignment of the Form is Centre of the screen, and Top on print. Depending on the height of the form and page, the form will be displayed or printed, leaving equal amount of space on the top and bottom of the form.

Widespaced

This attribute is used in a Field Definition to allow increased spacing between the characters of the string value specified in the field. It is used to create titles for the report/columns.

Syntax

Widespaced : <Logical Value>

Example:

Widespaced : Yes

Some Specific Attributes

Inactive

The Inactive attribute can be used in both a Field definition and a Button definition. When the attribute Inactive is set to YES in a Field definition, the Field loses its content but the size of the Field remains intact. In cases where a Button Definition is used, the Button becomes Inactive.

Syntax

Inactive : <Logical Formula>

Example:

[Field : TBCrAmount]

Set as   : $ClosingBalance

Inactive : $$IsDr:$ClosingBalance

In this example, the Field TBCrAmount is used to display the Credit Amount of the Ledger in a Trial Balance. When the Ledger Balance is Debit, the amount should not be displayed in the Credit Column but the Width should be utilized to avoid the Debit Field being shifted to the Credit Field. The Credit Totals to be calculated and displayed will also exclude the Debit Amount.

Invisible

This attribute can be specified in a Part, Line or a Field Definition. Based on the logical condition, this attribute decides whether the contents of the definition should be displayed or not. When this attribute is set to YES, it does not display the contents, but the contents are retained for further processing. In this case, contrary to Inactive, the size of the entire field is reduced to null, but the value is retained.

Syntax

Invisible : <Logical Formula>

Invisible – Field Definition

The Invisible attribute, when specified in a Field, denotes that the current field is excluded from all the further processing, based on satisfying a certain condition.

Example:

[Field : Attr Invisible]

Set as    : “Invisible Attribute”

Invisible : Yes

In this example, the Field attribute Invisible is used to display Credit Amount of the Ledger in a Trial Balance. When the Ledger Balance is debit, the amount should not be displayed/printed in the Credit Column and the Width is not utilized allowing the other fields to utilize the space. The Credit Totals being calculated and printed will also exclude the Debit Amount.

Note: In a Report, at least one Part, Line and Field should be visible.

Definitions and Attributes for Formatting

Definition - Border

The definition Border determines the type of lines required in a border which can be used by a Part, Line or a Field; which means that this definition can define customized borders for the user. But, it is ideal to use predefined borders, which are part of default TDL, instead of user defined ones, since almost all possible border combinations are already defined in the Default TDL.

Syntax

[Border : <Border Name>]

Top     : <Values separated by a comma>

Bottom : <Values separated by a comma>

Left     : <Values separated by a comma>

Right    : <Values separated by a comma>

Color    : <Color Name – B&W, Color Name - Color>

PrintFG : <Color Name>

Attributes - Top, Bottom, Left and Right

The Top, Bottom, Left and Right attributes in a Border Definition are used to add appropriate lines which constitute the Border defined. The permissible values for these attributes are:

Thin/Thick : This specifies whether the Line should be thin or thick.

Flush : The border includes the spaces on the Top, Bottom, Left or Right.

Full Length : This ignores the space given at the Top, Bottom, Left or Right and prints the border for the whole length.

Double : It forces double line to be printed. In its absence, single line is assumed.

Example:

[Border : Thin Bottom Right Double]

Bottom : Thin, Flush, Full Length

Right  : Thin, Double

[Field : Total Field]

Set aS : $Total

Border : Thin Bottom Right Double

Attribute - Color

The Color attribute of the Border definition is used to specify the Color required for the border in Display mode. In a Border definition, the attribute Color requires two values to be specified, viz. First value for a Black and White Monitor, and the second for a Color monitor.

[Border : Top Bottom Colored]

Top    : Thin

Bottom : Thin

Color  : "Deep Grey, LeafGreen"

[Field : Total Field]

Set AS : $Total

Border : Top Bottom Colored

Attribute - PrintFG

This attribute is used to specify the Color required for the border during printing.

[Border : Top Bottom Colored]

Top      : Thin

Bottom   : Thin

Color    : "Deep Grey, Leaf Green"

Print FG : “Leaf Green”

[Field : Total Field]

Set AS : $Total

Border : Top Bottom Colored

Definition - Style

The definition Style can be used in the Field definition only. This definition determines the appearance of the text being displayed/printed, by using a corresponding font scheme, i.e., Bold, Italic, Point Size, Font Name, etc. The Style attribute in Field Definition is used to format the appearance of the text appearing within the Field, both in Display and Print mode, provided the Print Style attribute is not used within the current Field. The Print Style attribute is used in Field, if the Style required while displaying is different from the Style required while printing.

Syntax

[Style : <Style Name>]

Font    : <Font Name>

Height : <required Font Height in Point Size>

Bold    : <Logical Formula>

Italic   : <Logical Formula>

Attribute - F o nt

It is a generic Font name supported by the Operating System. A Font is system dependent and we do not have any control over them. One can only select the required fonts from those available.

Example:

[Style : Normal]

Font   : if $$IsWindows then "Arial" else "Helvetica"

Height : @@NormalSize

[Style : Normal Bold]

Use : Normal

Bold: Yes

[Field : Party Name]

Set aS      : $PartyLedgerName

Style       : Normal

Print Style : Normal Bold

Attribute - Hei g ht

This attribute should be specified without any measurement, since it is always measured in terms of points. It can have value as a fraction, or as a formula which returns a number. One can also grow or shrink the Height by a multiplication factor or percentage.

Example:

[Style: Normal Large]

Use    : Normal

Height : Grow 25%

Attribute - Bold

The attribute Bold can only take logical values/formula. In other words, it can take either a YES or NO. It signifies that the field using this Style should be printed in Bold.

Example:

[Style : Normal Bold Large]

Use  : Normal Large

Bold : Yes

Attribute - Italic

The attribute Italic can only take logical values/formula. In other words, it can be set to either YES or NO. It signifies that the Field using this Style should be printed in Italics.

Example:

[Style : Normal Large Italics]

Use    : Normal Large

Italic : Yes

Definition - Color

The definition Color is useful to determine the Foreground and Background Color for a Form, Part, Field or Border, in Display as well as in Print Mode. A Color specification can be done by specifying the RGB Values (the combination of Red, Green and Blue - each value should range from 0 to 255).

Syntax

[Color : <Color Name>]

RGB : <Red>, <Green>, <Blue>

Attribute - RGB

This is the second way of specifying color. One can specify the RGB value from a palette of 256 colors to obtain the required color, i.e., the values Red, Green and Blue can each range from 0 to 255. This gives the user the option to select from the wide range of 24 bit colors.

Example:

[Color : Pale Leaf Green]

RGB : 169, 211, 211

[Field : Party Name]

Set as    : $PartyLedgerName

Color     : Pale Leaf Green

Print FG  : Pale Leaf Green

Attrib u tes Backg rou n d an d Print BG

The attribute Background is used to set the Background Color of a Form, Part or a Field in Display mode. The Print BG attribute is used to set the Background Color of a Form, Part or a Field in Print mode.

Syntax

[Form : <Form Name>]

Background : <Color Name Formula>

Print BG : < Color Name Formula>

[Part : <Part Name>]

Background : <Color Name Formula>

Print BG   : <Color Name Formula>

[Field : <Field Name>]

Background : <Color Name Formula>

Print BG   : <Color Name Formula>

Example:

[Form : Salary Detail Configuration]

Background : @@SV_CMPCONFIG

[Part : Party Details]

Background : Red Print BG : Green

[Field : Party Ledger Name]

Background : Yellow

Print BG   : Red

Attrib u te - Format

The attribute Format is used in the Field definition. It determines the Format of the value being displayed/printed within the Field.

Syntax

[Field : <Field Name>]

Format : <Formatting Values separated by comma>

The value for the attribute Format varies, based on the data type of the Field.

Field of Type Number

Example:

[Field : My Rate of Excise]

Set AS : $BasicRateOfInvoiceTax

Format : “No Comma, Percentage”

Field of Type Date

Example:

[Field : Voucher Date]

Set AS : $Date

Format : “Short Date”

Field of Type Amount

Example:

[Field : Bill Amount]

Set AS : $Amount

Format : “No Zero, No Symbol”

Field of Type Quantity

Example:

[Field : Bill Qty]

Set as : $BilledQty

Format : “No Zero, Short Form, No Compact”

Learning Outcome

The following four definitions in TDL attract dimensions:

o Form

o Part

o Line

o Field

In TDL, Dimensional attributes are used for specifying the dimensions.

The Definition Style determines the appearance of the text being displayed/printed by using the corresponding Font scheme, i.e., Bold, Italic, Point Size, Font Name, etc.

The Definition Color is useful to determine the Foreground and Background color for a Form, Part, Field or Border, in Display as well as Print Mode.

The attribute Format is used in the Field Definition. It determines the Format of the value being displayed/printed within the Field.