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.
To specify a font size, use the following syntax within a StyleSheet.
TYPE = type, [subtype,] SIZE=pts, $
where:
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:
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 |
To specify a font style, use the following syntax within a StyleSheet.
TYPE=type, [subtype,] STYLE=[+|-]txtsty[{+|-}txtsty], $
where:
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.
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:
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:
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:
(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.
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 |
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.
To specify a font for your report, use the following syntax within a StyleSheet.
TYPE=type, [subtype,] FONT='font[,font]',$
where:
Note: In an HTML report, specifying different fonts for several different report components significantly increases the size of the source code.
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',$
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:
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: