General WebFOCUS StyleSheet Syntax

In this section:

How to:

A StyleSheet consists of declarations that identify the report components you wish to format and the formatting you wish to apply. A declaration usually begins with the TYPE attribute and is followed by the attribute=value pairs you assign to the report component. You can also include comments that provide context for your StyleSheet. Comments do not affect StyleSheet behavior. For details, see Adding a Comment to a WebFOCUS StyleSheet.

For information about identifying a report component, see Identifying a Report Component in a WebFOCUS StyleSheet.


Top of page

x
Syntax: How to Specify a WebFOCUS StyleSheet Declaration

Each StyleSheet declaration specifies a series of attributes in the form

attribute = value, [attribute = value, ...] $

where:

attribute
Is the attribute you are specifying, such as TYPE, COLUMN, COLOR, or FONT.
value
Is the value you assign to the attribute.


Example: Sample WebFOCUS StyleSheet

Following is a request that includes an inline StyleSheet. The StyleSheet begins with ON TABLE SET STYLE * and ends with ENDSTYLE.

TABLE FILE CENTORD
HEADING
" "
"C e n t u r y  C o r p o r a t i o n"
" "
"Order Revenue - 2000 Q3"
" "
"page <TABPAGENO"
" "
SUM ORDER_DATE/MtDY ORDER_NUM LINEPRICE AS 'Order,Total:'
BY LOWEST 9 ORDER_DATE NOPRINT
WHERE (ORDER_DATE GE '2000/10/01') AND (ORDER_DATE LE '2000/12/31');
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
 
ON TABLE SET STYLESHEET *
TYPE=Report, GRID=Off, UNITS=Inches, $
TYPE=Data, FONT='Times', $
TYPE=Data, BACKCOLOR=Aqua, COLOR=Navy,
     WHEN=LinePrice GT 500000, $
TYPE=Data, COLUMN=LinePrice, BACKCOLOR=Aqua, COLOR=Navy, STYLE=Bold,
     WHEN=LinePrice GT 500000, $
TYPE=Title, FONT='Helvetica', $
TYPE=Heading, FONT='Helvetica', STYLE=Bold, SIZE=14, JUSTIFY=Center,
     COLOR=White, BACKCOLOR=Dark Turquoise, $
TYPE=Heading, LINE=6, BACKCOLOR=White, COLOR=Dark Turquoise, $
TYPE=Heading, LINE=7, BACKCOLOR=White, $
ENDSTYLE
 
END

Top of page

x
Improving WebFOCUS StyleSheet Readability

There are many ways to structure your StyleSheet declarations in order to make the StyleSheet easy to read. You can do any one, or a combination, of the following:


Top of page

x
Adding a Comment to a WebFOCUS StyleSheet

You can add comments to a StyleSheet to give context to a declaration. Comments do not affect StyleSheet behavior.

You can add a comment:

Note: You can add comments anywhere in your request, not only in StyleSheets.


Top of page

x
Validating WebFOCUS StyleSheet Syntax

How to:

You can check a StyleSheet file to see if there are any syntax errors in it using the CHECK STYLE command. CHECK STYLE does not check the spelling of font names, nor does it verify the availability of specified fonts on your system.

You can issue the CHECK STYLE command in the Command Console in Developer Studio.



x
Syntax: How to Validate WebFOCUS StyleSheet Syntax

To validate the syntax of a StyleSheet file, issue this command from the Command Console in Developer Studio

CHECK STYLE file

where:

file
Is the name of the StyleSheet file. Do not include the file extension.

WebFOCUS