Formatting an FML Report

In this section:

How to:

Improve the readability and presentation of your FML report by:

Note: You can also format an FML report using StyleSheet attributes if you are creating an output format that supports StyleSheets.


Top of page

x
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.


Top of page

x
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.

PAGE     1
                     AMOUNT
                     ------
CASH ON HAND          8,784
DEMAND DEPOSITS       4,494
TIME DEPOSITS         7,961
                     ------
TOTAL CASH           21,239
PAGE     2
                     AMOUNT
                     ------
ACCOUNTS RECEIVABLE  18,829
INVENTORY            27,307
                     ------
TOTAL ASSETS         46,136
PAGE     3
                     AMOUNT
                     ------
TOTAL                67,375


Top of page

x
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


Example: 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

Top of page

x
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 increase the width of the indented column if it is not wide enough to accommodate the indented fields. While this is no problem in an HTML report, in a PDF or PostScript report it can cause data in the columns that follow the indented column to shift out of alignment. You may need to use StyleSheet syntax to make the column wide enough for the indented values or to move the columns that follow it. Change the width of a column using the StyleSheet SQUEEZE attribute, and specify a starting position for a column using the POSITION attribute. You can also move a column in a PostScript report with the IN phrase.

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. See Formatting an FML Report.



x
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 HOLD FORMAT HTML 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE = REPORT, GRID = OFF, $
ENDSTYLE
END

The output is shown in the following image.

report



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, 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 HOLD FORMAT HTMLON TABLE SET STYLE *
TYPE = REPORT, GRID = OFF, $
ENDSTYLE
END

The output is shown in the following image.

report


Information Builders