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:
Is the name you assign to the macro you are creating.
Is any StyleSheet attribute, such as an attribute to format a report component, insert a graphic, or apply a condition for conditional formatting (WHEN).
Is the value you want to assign to the attribute.
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.
Is any additional attribute, such as COLUMN, ACROSS, or ITEM, that is needed to identify the report component to which you are applying the macro. See Identifying Report Components, for information about how to specify different types of report components.
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 to make this declaration conditional.
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 HOLD FORMAT HTML 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:
|
Information Builders |