General StyleSheet Syntax

Topics:

A StyleSheet, identified by the ON TABLE SET STYLE command in a report request, 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, for example, COLUMN, COLOR, or FONT. You can also include comments that provide context for your StyleSheet. Comments do not affect StyleSheet behavior.

Each StyleSheet declaration specifies a series of attributes in the format:

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

Creating a WebFOCUS StyleSheet Within a Report Request

You can create a StyleSheet within a report request. This enables you to create and maintain the formatting for your report directly in the report request. This type of StyleSheet is known as an inline StyleSheet.

The format for creating a StyleSheet within a report request is:

ON TABLE SET STYLE[SHEET] * 
declaration 
[declaration]
.
.
.
[ENDSTYLE]

StyleSheet declarations usually specify the report component you want to format and the formatting you want to apply. ENDSTYLE Indicates the end of an inline StyleSheet.

The format to apply an external StyleSheet file within your report request is:

ON TABLE SET STYLE[SHEET] stylesheet

Issue the following request, which illustrates an inline StyleSheet. The StyleSheet declarations are highlighted in the request.

TABLE FILE EMPLOYEE
SUM CURR_SAL BY DEPARTMENT BY LAST_NAME
HEADING
"Employee Salary Report"
" "
FOOTING CENTER
"**End of Report**"
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=HEADING, FONT=ARIAL, SIZE=16, STYLE=BOLD, $
TYPE=TITLE, STYLE=ITALIC, $
TYPE=DATA, COLUMN=DEPARTMENT, STYLE=BOLD, COLOR=BLUE, $
TYPE=FOOTING, COLOR=RED, STYLE=BOLD, $
ENDSTYLE
END

Run the request. The output is:

Creating and Applying a StyleSheet File

You can create a StyleSheet as a separate file and apply it to as many reports as you wish. A StyleSheet file contains only declarations and optional comments. Unlike an inline StyleSheet, a StyleSheet file does not contain the ON TABLE SET STYLESHEET and ENDSTYLE commands. You can apply a StyleSheet file to a report using the SET STYLESHEET command.

You should name a StyleSheet file filename.sty, where filename can include letters, numbers, and underscores (_), and otherwise must be valid for the operating environments on which it resides.

As an alternative to creating a new StyleSheet file, you can use one of the sample StyleSheet files provided with the product as a template.

The format to include a SyleSheet File in another StyleSheet is:

INCLUDE=stylesheet,$

To use one of the distributed StyleSheets in the inline report (INCLUDE) and override the heading and department styles (TYPE=HEADING, TYPE=DATA), issue the following request:

TABLE FILE EMPLOYEE
SUM CURR_SAL BY DEPARTMENT BY LAST_NAME
HEADING
"Employee Salary Report"
" "
FOOTING CENTER
"**End of Report**"
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *

INCLUDE=IBFS:/FILE/IBI_HTML/ibi_themes/Warm.sty,$

TYPE=REPORT, GRID=OFF, $
TYPE=HEADING, FONT=ARIAL, SIZE=16, STYLE=BOLD + ITALIC, $
TYPE=TITLE, STYLE=ITALIC, $
TYPE=DATA, COLUMN=DEPARTMENT, STYLE=BOLD + UNDERLINE, COLOR=BLUE, $
ENDSTYLE
END

Run the request. The output is:

WebFOCUS

Feedback