Formatting an FML Report

In this section:

How to:

Improve the readability and presentation of your FML report by:

Syntax: How to Add an Underline Character for Columns

BAR [AS 'character'] OVER

where:

character
Is either the hyphen character (-) or the equal character (=). Enclose the character in single quotation marks. The default character is the hyphen (-).

Example: Underlining Columns

This example uses the default underscore character (_).

TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'       OVER
1020 AS 'DEMAND DEPOSITS'    OVER
1030 AS 'TIME DEPOSITS'      OVER 
BAR                          OVER 
RECAP TOTCASH = R1 + R2 + R3;
END

The output is shown as follows.

                 AMOUNT
                 ------
CASH ON HAND      8,784
DEMAND DEPOSITS   4,494
TIME DEPOSITS     7,961
                 ------
TOTCASH          21,239

Notice that the BAR ... OVER phrase underlines only the column containing the display field.

Syntax: How to Specify a Page Break in an FML Report

Include the following syntax in the FML request in place of a tag value.

PAGE-BREAK OVER

Example: Specifying a Page Break in an FML Report

In this example, a page break is inserted after the first two RECAP commands to highlight each calculation.

TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'                                    OVER
1020 AS 'DEMAND DEPOSITS'                                 OVER
1030 AS 'TIME DEPOSITS'                                   OVER
BAR                                                       OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH'             OVER 
PAGE-BREAK                                                OVER 
1100 AS 'ACCOUNTS RECEIVABLE' LABEL RECEIVE               OVER
1200 AS 'INVENTORY'  LABEL INVENT                         OVER
BAR                                                       OVER
RECAP TOTASSET = RECEIVE + INVENT; AS 'TOTAL ASSETS'      OVER 
PAGE-BREAK                                                OVER 
RECAP TOTAL = TOTCASH + TOTASSET;
END

The output is shown as follows.

Syntax: How to Format a Row, Column, or Cell in an FML Report

TYPE=type, [COLUMN=column] [LABEL={Rn|label}], format_def, $

where:

type

Identifies the component you wish to format. Valid values are:

REPORT denotes a row with the specified label.

DATA denotes a row with the specified label, which contains user-supplied data values.

FREETEXT denotes a free text or a blank row with the specified label.

UNDERLINE denotes underlines generated by BAR. Formatting of an underline is supported for PDF and PS, but not for HTML reports.

column

Identifies a specific column. You can identify the column by its name or position in a row.

LABEL

Is the controlling factor in identifying and formatting an FML row.

Note that the label is used to identify a row for calculation or formatting. The label for a TAG or DATA row never appears in the report output. It is used only to identify rows within the FML code. For a RECAP row, the name of the calculated value serves as a label. It appears in the report unless an alternate title is specified.

label is an explicit row label that you can assign to identify a row more clearly.

format_def

Is the formatting definition, such as FONT, SIZE, STYLE, and COLOR. See Formatting an FML Report.

Note: To format a cell, identify the cell as the intersection of a column and a row using COLUMN= ... plus LABEL= ... in the same StyleSheet declaration.

Example: Formatting Rows in an FML Report

The following illustrates how to identify and format an entire FML row, consisting of the row label and the row data. The LABEL attribute in the StyleSheet identifies the three TAG rows, which are styled here as italic.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND' LABEL COH OVER
1020 AS 'DEMAND DEPOSITS' LABEL DD OVER
1030 AS 'TIME DEPOSITS' LABEL TD OVER
BAR OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH' 
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, LABEL = COH, STYLE = ITALIC, $ 
TYPE = REPORT, LABEL = DD,  STYLE = ITALIC, $ 
TYPE = REPORT, LABEL = TD,  STYLE = ITALIC, $ 
ENDSTYLE
END

The output is shown in the following image.

Applying Boldface to a TAG Row in an FML Report

This request applies boldface to the customized row title, CASH, and to the related data in the AMOUNT column. The StyleSheet uses the explicit label CA to identify the component to format.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
10$$ AS 'CASH'                LABEL CA   OVER
1100 AS 'ACCOUNTS RECEIVABLE' LABEL AR   OVER
1200 AS 'INVENTORY'           LABEL INV  OVER
RECAP CURASST/I5C = CA + AR + INV;
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, LABEL = CA, STYLE = BOLD, $ 
ENDSTYLE
END

The output is shown in the following image.

Applying Boldface to a Cell in an FML Matrix

This request generates a report in which the data value for AMOUNT is bold in the row titled CASH. However, the row title CASH is not bold. This is accomplished by pinpointing the cell in the StyleSheet declaration. In this case, the column (N2) within the row (CA).

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
10$$ AS 'CASH'                LABEL CA   OVER
1100 AS 'ACCOUNTS RECEIVABLE' LABEL AR   OVER
1200 AS 'INVENTORY'           LABEL INV  OVER
RECAP CURASST/I5C = CA + AR + INV;
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, COLUMN = N2, LABEL = CA, STYLE = BOLD, $ 
ENDSTYLE
END

The output is shown in the following image.

Applying Boldface to a Column in an FML Report

This request identifies the AMOUNT column by name and formats its title and data in bold. The same result is achieved if the column is identified as N2.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
"---CASH ACCOUNTS---"                   OVER
1010 AS 'CASH ON HAND'                  OVER
1020 AS 'DEMAND DEPOSITS'               OVER
1030 AS 'TIME DEPOSITS'                 OVER
" "                                     OVER
"---OTHER CURRENT ASSETS---"            OVER
1100 AS 'ACCOUNTS RECEIVABLE'           OVER
1200 AS 'INVENTORY'
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, COLUMN = AMOUNT, STYLE = BOLD, $ 
ENDSTYLE
END

The output is shown in the following image.

Applying Boldface to a Free Text Row

This request styles the free text as bold. Since in this example the same styling applies to both free text rows, labels are not required to distinguish between them.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
"---CASH ACCOUNTS---"  LABEL CA         OVER
1010 AS 'CASH ON HAND'                  OVER
1020 AS 'DEMAND DEPOSITS'               OVER
1030 AS 'TIME DEPOSITS'                 OVER
" "                                     OVER
"---OTHER CURRENT ASSETS---"  LABEL OCA OVER
1100 AS 'ACCOUNTS RECEIVABLE'           OVER
1200 AS 'INVENTORY'
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = FREETEXT, STYLE = BOLD, $ 
ENDSTYLE
END

The output is shown in the following image.

Formatting Free Text Rows Separately in an FML Report

This request uses the SIZE attribute to distinguish two lines of free text: CASH ACCOUNTS and OTHER CURRENT ASSETS. The labels CA and OCA are used to identify and format each row separately.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT 
" --- CASH ACCOUNTS ---" LABEL CA            OVER 
1010 AS 'CASH ON HAND'                       OVER
1020 AS 'DEMAND DEPOSITS'                    OVER
1030 AS 'TIME DEPOSITS'                      OVER
" "                                          OVER 
" --- OTHER CURRENT ASSETS ---" LABEL OCA    OVER 
1100 AS 'ACCOUNTS RECEIVABLE'                OVER
1200 AS 'INVENTORY'
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = FREETEXT, LABEL = CA, STYLE = BOLD, SIZE = 12, $ 
TYPE = FREETEXT, LABEL = OCA, STYLE = BOLD, SIZE = 10, $ 
ENDSTYLE
END

The output is shown in the following image.

Styling Text and a Variable in a Free Text Row

In this example, the text and variable components of the free text row are styled separately. The text, Current Assets, is italic and the value derived from the RECAP calculation is bold.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT AS 'Amount' FOR ACCOUNT
10$$ AS 'Cash'                   LABEL CA    OVER
1100 AS 'Accounts Receivable'    LABEL AR    OVER
1200 AS 'Inventory'              LABEL INV   OVER
RECAP CURASST/I5C = CA + AR + INV; NOPRINT  OVER
"Current Assets: <CURASST"
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID=OFF, $ 
TYPE = FREETEXT, OBJECT = TEXT, ITEM = 1, SIZE = 12, STYLE = ITALIC, $ 
TYPE = FREETEXT, OBJECT = FIELD, ITEM = 1, STYLE = BOLD, $ 
ENDSTYLE
END

The output is shown in the following image.

Applying Boldface to an FML RECAP Row

This request applies boldface to the row title and calculated value in a RECAP row. Notice that the RECAP label in the StyleSheet is TOTCASH. In a RECAP, the name assigned to the calculated value serves as the explicit label.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'    LABEL CASH    OVER
1020 AS 'DEMAND DEPOSITS' LABEL DD      OVER
1030 AS 'TIME DEPOSITS'   LABEL TD      OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH'
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, LABEL = TOTCASH, STYLE = BOLD, $ 
TYPE = REPORT, LABEL = CASH, COLUMN = N1, STYLE = ITALIC, $
TYPE = REPORT, LABEL = DD, COLUMN = N1, STYLE = ITALIC, $
TYPE = REPORT, LABEL = TD, COLUMN = N1, STYLE = ITALIC, $
ENDSTYLE
END

The output is shown in the following image.

 

Syntax: How to Add and Format Row and Cell Borders

To request a uniform border around a row or cell, use this syntax:

TYPE=REPORT, LABEL=row_label, [COLUMN=column,] BORDER=option,
[BORDER-STYLE=line_style,] [BORDER-COLOR={color|RGB® g b)},] $

To specify different characteristics for the top, bottom, left, and/or right borders, use this syntax:

TYPE=REPORT, LABEL=row_label, [COLUMN=column,] BORDER-position=option,
[BORDER-[position-]STYLE=line_style,]
[BORDER-[position-]COLOR={color|RGB(r g b)},] $

To specify different characteristics for the top, bottom, left, and/or right borders, use this syntax:

TYPE=REPORT, LABEL=row_label, [COLUMN=column,] BORDER-position=option,
[BORDER-[position-]STYLE=line_style,]
[BORDER-[position-]COLOR={color|RGB(r g b)},] $

where:

row_label

Is the row to which the specified border characteristics are applied.

column

Used in conjunction with row label. Designates a cell (at the point of intersection of the row and the column) to which the specified border characteristics are applied.

option

Can be one of the following values:

ON turns borders on for the entire heading or footing. ON generates the same line as MEDIUM.

OFF turns borders off for the entire heading or footing. OFF is the default.

LIGHT specifies a thin line. You can specify a light line for the entire heading or footing, or for one or more border positions.

MEDIUM identifies a medium line (ON sets the line as MEDIUM). You can specify a light line for the entire heading or footing, or for one or more border positions. Note that the medium line setting ensures consistency with lines created with GRID attributes.

HEAVY identifies a thick line. You can specify a heavy line for the entire heading or footing, or for one or more border positions.

width specifies the line width in points (where 72 pts=1 inch). You can specify a line width in points for the entire heading or footing or for one or more border positions. Line width specified in points is displayed differently in HTML and PDF output. For uniform appearance, regardless of display format, use LIGHT, MEDIUM, or HEAVY.

position

Specifies which border line to format. Valid values are TOP, BOTTOM, LEFT, RIGHT.

You can specify a position qualifier for any of the BORDER keywords. This enables you to format line width, line style, and line color individually, for any side of the border.

line_style

Sets the style of the border line. WebFOCUS StyleSheets support all of the standard Cascading Style Sheets line styles. Several 3-dimensional styles are only available in HTML, as noted by asterisks. Valid values are:

NONE
SOLID
DOTTED
DASHED
DOUBLE*
GROOVE*
RIDGE*
INSET*
OUTSET*
color

Is one of the preset color values. The default value is BLACK.

If the display or output device does not support colors, it substitutes shades of gray.

RGB

Specifies the font color using a mixture of red, green, and blue.

(r g b)

Is the desired intensity of red, green, and blue, respectively. The values are on a scale of 0 to 255, where 0 is the least intense and 255 is the most intense. Note that using the three color components in equal intensities results in shades of gray.

Note: For HTML reports, the BORDERS feature requires that cascading style sheets be turned ON. This code is not required for PDF and PS reports.

Example: Emphasizing a Row Using Uniform Border Lines

This example places a dashed border of medium thickness around the RECAP row identified by the label TOTCASH. For HTML reports, the BORDERS feature requires that cascading style sheets be turned ON.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'    LABEL CASH    OVER
1020 AS 'DEMAND DEPOSITS' LABEL DD      OVER
1030 AS 'TIME DEPOSITS'   LABEL TD      OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH' 
ON TABLE SET ONLINE-FMT HTML 
ON TABLE SET HTMLCSS ON 
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF, $ 
TYPE = REPORT, LABEL = TOTCASH, BORDER = MEDIUM, 
  BORDER-STYLE = DASHED, $ 
ENDSTYLE
END

The output is shown in the following image.

Example: Emphasizing a Row Using Different Top/Bottom and Left/Right Borders

This example places a heavy black border line above and below the RECAP row identified by the label TOTCASH, and a thin silver dotted line to the left and right of each column in the row.

For HTML reports, the BORDERS feature requires that cascading style sheets be turned ON.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'    LABEL CASH    OVER
1020 AS 'DEMAND DEPOSITS' LABEL DD      OVER
1030 AS 'TIME DEPOSITS'   LABEL TD      OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH' 
ON TABLE SET ONLINE-FMT HTML 
ON TABLE SET HTMLCSS ON 
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF,$ 
TYPE = REPORT, LABEL = TOTCASH, 
     BORDER-TOP = HEAVY, 
     BORDER-BOTTOM = HEAVY, 
     BORDER-LEFT = LIGHT, 
     BORDER-RIGHT = LIGHT, 
     BORDER-TOP-STYLE = SOLID, 
     BORDER-BOTTOM-STYLE = SOLID, 
     BORDER-LEFT-STYLE = DOTTED, 
     BORDER-RIGHT-STYLE = DOTTED, 
     BORDER-LEFT-COLOR = 'SILVER', 
     BORDER-RIGHT-COLOR = 'SILVER', $
ENDSTYLE
END

The output is shown in the following image.

Example: Adding Uniform Border Lines Around a Cell

This example places a border of medium thickness around the cell in the second column of the row identified by the label TOTCASH. The combined LABEL and COLUMN specifications are identified in the cell. The BORDERS feature requires that cascading style sheets be turned ON.

SET PAGE-NUM=OFF
TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'    LABEL CASH    OVER
1020 AS 'DEMAND DEPOSITS' LABEL DD      OVER
1030 AS 'TIME DEPOSITS'   LABEL TD      OVER
RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH' 
ON TABLE SET ONLINE-FMT HTML 
ON TABLE SET HTMLCSS ON 
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID = OFF,$ 
TYPE = REPORT, LABEL = TOTCASH, COLUMN = N2, BORDER = MEDIUM, $ 
ENDSTYLE
END

The output is shown in the following image.

Syntax: How to Specify an Indent for an FML Label, Tag, or Caption

FOR forfield [IN k]
tag [[GET CHILDREN|WITH CHILDREN] n] INDENT m [AS ['text'|CAPTION]] 
[OVER]

or

RECAP fieldname[/format]=expression; INDENT m [AS 'text']

where:

forfield

Is a field in the data source whose values are included in the report.

k

Is the starting column for the FOR value in an FML report.

tag

Is a value of forfield to be displayed on a row of the FML report.

n

Is the number of levels of an FML hierarchy to display on the FML report.

m

Is a positive integer (zero is not supported) specifying the number of spaces to indent the tag value, label, or caption of an FML row or hierarchy. The indentation starts from column one if there is no IN phrase specified in the FOR command. If there is an IN phrase, indentation starts from the column specified in the IN phrase. The maximum indentation is the same as the maximum length of an AS name.

If you indent an FML hierarchy, the parent line of the hierarchy is indented the number of spaces specified as the indent. The hierarchy levels are indented two spaces from each other. If the GET CHILDREN phrase is used, the first line of the hierarchy is indented an additional two spaces because the hierarchy output begins with the first child rather than the parent. For more information about the use of GET CHILDREN, see Displaying an FML Hierarchy.

'text'

Is a label to be displayed on a row of the FML report.

CAPTION

Indicates that a caption field has been defined in the Master File.

OVER

Indicates that this row is not the last row to be displayed.

fieldname

Is a name you assign to the value calculated by the RECAP command.

format

Is the USAGE format for RECAP field. It cannot exceed the column width. The default is the format of the column in which the calculated value is displayed.

expression

Is the expression that describes how to calculate the field value for RECAP.

Example: Indenting a Tag Row in an FML Hierarchy

In the following request, the label of the second row for tag value 3000 is indented five spaces. Because the GET CHILDREN phrase is used, the first line of the FML hierarchy, in the third row for tag value 3000, is indented seven spaces (five + two).

SET FORMULTIPLE=ON
TABLE FILE CENTGL
PRINT GL_ACCOUNT_PARENT
FOR GL_ACCOUNT
3000                           AS 'Not Indented'        OVER
3000                 INDENT 5  AS 'Indented 5'          OVER
3000 GET  CHILDREN 2 INDENT 5  AS 'Hierarchy Indented 5'
END

The output is shown as follows.

                               Parent
                               ------
Not Indented                   3000
     Indented 5                3000
       Hierarchy Indented 5    3000
         Hierarchy Indented 5  3100
         Hierarchy Indented 5  3100
         Hierarchy Indented 5  3100
         Hierarchy Indented 5  3100
         Hierarchy Indented 5  3000
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200
         Hierarchy Indented 5  3200

Indenting FML RECAP Rows

The following request sums price, cost, and quantity in stock for digital and analog product types. The first RECAP command calculates the total for each column, and indents the label five spaces. The second RECAP command calculates the profit, and indents the label 10 spaces.

SET FORMULTIPLE=ON
TABLE FILE CENTINV
SUM PRICE COST QTY_IN_STOCK
FOR PRODTYPE
Digital                                          OVER
Analog                                           OVER
BAR                                              OVER
RECAP TOTAL = R1 + R2; INDENT 5  AS 'Total:'     OVER
BAR                                              OVER
RECAP PROFIT(2) = TOTAL(1) - TOTAL(2); AS 'Profit:' INDENT 10
END

The output is shown as follows.

                                        Our    Quantity 
                         Price:         Cost:  In Stock:
                         ------         -----  ---------
Digital                4,080.00      3,052.00     119143
Analog                 1,883.00      1,371.00     139345
                   ------------  ------------    -------
     Total:            5,963.00      4,423.00     258488
                   ------------  ------------    -------
          Profit:                    1,540.00

Indenting Row Titles in an FML Hierarchy

How to:

To clarify relationships within an FML hierarchy, the captions (titles) of values are indented at each level. Use the BLANKINDENT parameter in an HTML, PDF, or PostScript report to specify the indentation between each level in the hierarchy. You can use the default indentation for each hierarchy level or choose your own indentation value. To print indented captions in an HTML report, you must set the BLANKINDENT parameter to ON or to a number.

SET BLANKINDENT does not redefine the width of the indented column, if it is not wide enough to accommodate the indented fields. Columns in table-based formats will automatically size themselves as needed, while columns in position-based formats, such as PDF, PostScript, or PPTX, shift out of alignment. You can use StyleSheet syntax to make the column wide enough for the indented values, and move the columns that follow it. Change the width of a column using the StyleSheet SQUEEZE = n attribute to supply the required space.

A related feature enables you to change the number of blank spaces before the parent line of a hierarchy or before any FML tag or RECAP row in any FML request. For more information, see Formatting an FML Report.

Syntax: How to Indent FML Hierarchy Captions in an HTML Report

SET BLANKINDENT={ON|OFF|n}
ON TABLE SET BLANKINDENT {ON|OFF|n}

where:

ON

Indents FML hierarchy captions 0.125 units for each space that normally displays before the caption. For child levels in an FML hierarchy, it indents 0.125 units for each space that normally displays between this line and the line above it.

OFF

Turns off indentations for FML hierarchy captions in an HTML report. OFF is the default value. For other formats, uses the default indentation of two spaces.

n

Is an explicit measurement in the unit of measurement defined by the UNITS parameter. This measurement is multiplied by the number of spaces that normally displays before the caption. For child levels in an FML hierarchy, it indents n units for each space that normally displays between this line and the line above it. The default number of spaces is two. Zero (0) produces the same report output as OFF. Negative values for n are not supported.

Example: Using the Default Indentation for FML Hierarchy Captions

The following request creates an HTML report with the default indentation:

SET PAGE-NUM=NOPAGE
SET BLANKINDENT=ON
SET FORMULTIPLE=ON
TABLE FILE CENTGL
PRINT GL_ACCOUNT_PARENT
FOR GL_ACCOUNT
3000                  AS CAPTION      OVER
3000 GET  CHILDREN 2  AS CAPTION 

ON TABLE SET ONLINE-FMT HTML 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE = REPORT, GRID = OFF, $
ENDSTYLE
END

The output is shown in the following image.

Example: Specifying an Indentation Value for FML Hierarchy Captions

The following request specifies an indentation of .25 for each level of an FML hierarchy. This number is expressed in the default unit of measurement, which is inches:

SET PAGE-NUM=NOPAGE
SET BLANKINDENT=.25
SET FORMULTIPLE=ON
TABLE FILE CENTGL
PRINT GL_ACCOUNT_PARENT
FOR GL_ACCOUNT
3000                 AS CAPTION          OVER
3000 GET  CHILDREN 2 AS CAPTION

ON TABLE SET STYLE *
TYPE = REPORT, GRID = OFF, $
ENDSTYLE
END

The output is shown in the following image.