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.
TYPE=type, [subtype,] MACRO=macroname, [condition,] $
where:
Is the report component you wish to affect. You can specify any report component.
Are any additional attributes, such as COLUMN, ACROSS, or ITEM, that are needed to identify the report component to which you are applying the macro. For information about how to specify different types of report components, see Identifying a Report Component in a WebFOCUS StyleSheet.
Is the name of the macro to apply to the specified report component. The macro must be defined in the same StyleSheet.
Is an optional WHEN attribute that you can specify if you wish to make this declaration conditional. For information about conditional declarations, see Controlling Report Formatting.
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: