Specifying Font Format in a Report

In this section:

How to:

Reference:

Using StyleSheet attributes, you can enhance the appearance of a report by specifying the font, size, and color of the font. Font format can be designated for a report as a whole, or for headings, footings, and columns individually.

Syntax: How to Specify Font Size in a Report

To specify a font size, use the following syntax within a StyleSheet.

TYPE = type, [subtype,] SIZE=pts, $

where:

type
Is the report component you wish to affect, such as REPORT, HEADING, or TITLE.
subtype
Is any additional attribute, such as COLUMN, ACROSS, ITEM etc. that is needed to identify the report component that you are formatting. See Identifying a Report Component in a WebFOCUS StyleSheet for more information about how to specify different report components.
pts
Is the size of the font in points. The default value is 10, which corresponds to the HTML default font size 3. For more information on the correlation between point size and html font size, see Usage Notes for Changing Font Size.

Example: Specifying Font Size in a Report

In the following report request, the point size of column titles is set to 12:

TABLE FILE GGSALES
ON TABLE SET PAGE-NUM OFF 
SUM UNITS DOLLARS BY CATEGORY
ON TABLE SET STYLE * 
TYPE=TITLE, SIZE=12, $ 
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is:

Reference: Usage Notes for Changing Font Size

Point size is fixed, except in an HTML report. Relative point size uses a different scale than HTML font size. The following table lists the point size and the corresponding HTML font size:

Size in Points

Corresponding HTML Font Size

8 or smaller

1

9

2

10

3

11

4

12

5

13

6

14 or larger

7

Syntax: How to Specify Bold or Italic Font Style in a Report

To specify a font style, use the following syntax within a StyleSheet.

TYPE=type, [subtype,] STYLE=[+|-]txtsty[{+|-}txtsty], $

where:

type
Is the report component you wish to affect, such as REPORT, HEADING, or TITLE.
subtype
Is any additional attribute, such as COLUMN, ACROSS, ITEM etc. that is needed to identify the report component that you are formatting. See Identifying a Report Component in a WebFOCUS StyleSheet for more information about how to specify different report components.
txtsty
Is one of the following values: NORMAL, BOLD, ITALIC. The default value is NORMAL.

Note that if you specify a style that is not supported for the font you are using, the specified font will display without the style.

+
Enables you to specify a combination of font styles. You can add additional font styles to an attribute that already has one or more font styles applied to it.
-
Enables you to remove a font style from an attribute.

Example: Specifying Font Style in a Report

In the following report, the column titles are specified to have bold and italic font styles:

TABLE FILE GGSALES
SUM UNITS DOLLARS BY CATEGORY 
ON TABLE SET STYLE *
TYPE=TITLE, STYLE=BOLD+ITALIC, $
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is:

Example: Adding and Removing Inherited Font Style in a Report

In the following report request, the font styles bold and italics are specified for the entire report. The inherited italics are removed from the heading, and both styles are removed from the column titles:

TABLE FILE GGSALES
HEADING
"Sales Report by Category"
SUM UNITS DOLLARS BY CATEGORY 
ON TABLE SET STYLE * 
TYPE=REPORT, STYLE=BOLD+ITALIC, $
TYPE=HEADING, STYLE=-ITALIC, $
TYPE=TITLE, STYLE=-BOLD-ITALIC, $ 
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is:

Syntax: How to Specify Font Color in a Report

To specify a color for the font of a report or a report component, use the following syntax within a StyleSheet.

TYPE=type, [subtype,] COLOR={color|RGB({r g b|#hexcolor})},$

where:

type
Is the report component you wish to affect, such as REPORT, HEADING, or TITLE.
subtype
Is any additional attribute, such as COLUMN, ACROSS, ITEM etc. that is needed to identify the report component that you are formatting. See Identifying a Report Component in a WebFOCUS StyleSheet for more information about how to specify different report components.
color
Is one of the preset color values such as GREY or GOLD. If the display or output device does not support colors, it substitutes shades of gray. The default value is BLACK. For a complete list of available color values, see Color Values in a Report.
RGB(r g b)
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.

RGB(#hexcolor)
Is the hexadecimal value for the color. For example, FF0000 is the hexadecimal value for red. The hexadecimal digits can be in upper or lower case and must be preceded by a pound sign (#).

Reference: Color Values in a Report

The following chart lists all available color values that can be utilized with the syntax

COLOR=color, or BACKCOLOR=color,

where color is one of the following values:

AQUA (CYAN)
MEDIUM FOREST GREEN (OLIVE)
AQUAMARINE
MEDIUM GOLDENROD
BLACK
MEDIUM ORCHID
BLUE VIOLET
MEDIUM SLATE BLUE
CADET BLUE
MEDIUM SPRING GREEN
CORAL
MEDIUM TURQUOISE
CORNFLOWER BLUE
MEDIUM VIOLET RED
CYAN (AQUA)
MIDNIGHT BLUE
DARK GREEN
NAVY (NAVY BLUE)
DARK OLIVE GREEN
OLIVE (MEDIUM FOREST GREEN)
DARK ORCHID
ORANGE
DARK SLATE BLUE (PURPLE)
ORANGE RED
DARK SLATE GREY
ORCHID
DARK TURQUOISE
PALE GREEN
DIM GREY (GRAY, GREY)
PINK
FIREBRICK
PLUM
FOREST GREEN (GREEN)
PURPLE (DARK SLATE BLUE)
FUCHSIA (MAGENTA)
RED
GOLD
SALMON
GOLDENROD
SEA GREEN
GRAY (DIM GREY, GREY)
SIENNA
GREEN (FOREST GREEN)
SILVER
GREEN YELLOW
SKY BLUE
GREY (DIM GREY, GRAY)
SLATE BLUE
INDIAN RED
STEEL BLUE (TEAL)
KHAKI
TAN
LIGHT BLUE
TEAL (STEEL BLUE)
LIGHT GREY
THISTLE
LIGHT STEEL BLUE
TURQUOISE
LIME
VIOLET
LIME GREEN
VIOLET RED
MAGENTA (FUCHSIA)
WHEAT
MAROON
WHITE
MEDIUM AQUAMARINE
YELLOW
MEDIUM BLUE
YELLOW GREEN

Specifying Fonts for Reports

How to:

You can specify your own fonts in a report by using the FONT attribute in a StyleSheet. If you are specifying a font for an HTML report, the web browser must support the font. If the web browser does not support the font, it reverts to its default behavior of using the default proportional font.

Syntax: How to Specify Fonts in a Report

To specify a font for your report, use the following syntax within a StyleSheet.

TYPE=type, [subtype,] FONT='font[,font]',$

where:

type
Is the report component you wish to affect, such as REPORT, HEADING, or TITLE.
subtype
Is any additional attribute, such as COLUMN, ACROSS, ITEM etc. that is needed to identify the report component that you are formatting. See Identifying a Report Component in a WebFOCUS StyleSheet for more information about how to specify different report components.
font
Is the name of the font. You must enclose the value in single quotes. If you are creating an HTML report, you can specify more than one font within the single quotes to accommodate more than one browser.

Note: In an HTML report, specifying different fonts for several different report components significantly increases the size of the source code.

Example: Specifying Multiple Fonts in an HTML Report

To control how a report looks on more than one platform, you can specify both a common Windows font and a common UNIX font in a request. The web browser searches for the first font in the list. If the browser does not find the first font, it searches for the next font in the list. If none of the fonts are identified, the browser uses the default proportional font.

In this example, the web browser first searches for the Arial font. If the browser does not find Arial, it searches for the Helvetica font. If neither font is identified, the browser uses the default proportional font.

TYPE=REPORT, FONT='ARIAL,HELVETICA',$ 

Syntax: How to Specify the Default Browser Fonts for HTML Reports

A browser assigns specific fonts as the default proportional and default monospaced fonts. To specify a default browser font for an HTML report, you use the reserved names, DEFAULT-PROPORTIONAL and DEFAULT-FIXED in the StyleSheet of your report. The browser displays the report accordingly.

To select the default fixed or proportional font of the browser, use the following syntax. Note that you must specify TYPE to indicate which report components you wish to affect.

FONT={DEFAULT-PROPORTIONAL|DEFAULT-FIXED},$

where:

DEFAULT-PROPORTIONAL
Specifies the default proportional font of the web browser.
DEFAULT-FIXED
Specifies the default monospaced font of the web browser.

Example: Specifying Default Browser Fonts

In this example, the web browser uses the default monospace font for the entire report except the report heading and the column headings. For these headings, the web browser uses the default proportional font.

TABLE FILE GGSALES
HEADING
"Sales Report"
SUM UNITS DOLLARS BY CATEGORY BY PRODUCT
ON TABLE SET STYLE * 
TYPE=REPORT,FONT=DEFAULT-FIXED,$
TYPE=TITLE,FONT=DEFAULT-PROPORTIONAL,$
TYPE=HEADING,FONT=DEFAULT-PROPORTIONAL,$ 
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is: