In this section: How to: |
Improve the readability and presentation of your FML report by:
Note: For an HTML, PDF, or PostScript report, you can use the BLANKINDENT setting to specify an indentation between levels of an FML hierarchy. See Indenting Row Titles in an FML Hierarchy.
Note: You can also format an FML report using StyleSheet attributes if you are creating an output format that supports StyleSheets.
BAR [AS 'character'] OVER
where:
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.
Include the following syntax in the FML request in place of a tag value:
PAGE-BREAK OVER
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
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:
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.
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
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
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.
SET BLANKINDENT={ON|OFF|n} ON TABLE SET BLANKINDENT {ON|OFF|n}
where:
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.
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.
Information Builders |