In this section: |
If you frequently use a group of attributes within a StyleSheet declaration, you can create a StyleSheet macro that groups the sequence of attributes together, enabling you to apply them repeatedly throughout the StyleSheet without recoding them.
How to: |
A StyleSheet macro must be defined in the StyleSheet that references it and the macro definition must precede its use in the StyleSheet.
To define a macro, use the DEFMACRO attribute followed by the desired styling attributes.
DEFMACRO = macroname, attribute1 = value1, [attribute2 = value2,]... $
where:
How to: |
A StyleSheet macro applies all the formatting defined in the macro to the report component specified in the declaration. To apply a macro, use the MACRO attribute. You can apply one macro per declaration.
When applying a StyleSheet macro to a report component, you can override any attribute defined in the macro by specifying the same attribute with the new value in that declaration, following the MACRO attribute. For an example, see Defining, Applying, and Overriding a WebFOCUS StyleSheet Macro.
TYPE=type, [subtype,] MACRO=macroname, [condition,] $
where:
The following annotated example illustrates how to define, apply, and override macros in your StyleSheet:
TABLE FILE GGSALES
SUM UNITS DOLLARS
BY CATEGORY BY PRODUCT
HEADING
"Sales Report"
FOOTING
"Sales Report - Page <TABPAGENO"
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
1. DEFMACRO=A, STYLE=BOLD, SIZE=12, $
2. DEFMACRO=BI, STYLE=BOLD+ITALIC, COLOR=PURPLE, $
3. TYPE=HEADING, MACRO=A, $
4. TYPE=FOOTING, MACRO=BI, COLOR=BLACK, $
5. TYPE=DATA, COLUMN=N1, MACRO=BI, $
ENDSTYLE
END
The output is:
WebFOCUS |