Working With an External Cascading Style Sheet

In this section:

When you work with an external cascading style sheet (CSS) to specify report formatting, you need to know about:

Top of page

Choosing an External Cascading Style Sheet

To format a report using an external cascading style sheet (CSS), you can choose to:

To create an external cascading style sheet, use a text editor or a third-party web development tool.

Top of page

External Cascading Style Sheet Location

An external cascading style sheet (CSS) can reside on any web server platform. However, if CSSURL (the StyleSheet attribute or the SET parameter) specifies a relative URL, the cascading style sheet must reside on the web server used by WebFOCUS.

Top of page

Using Several External Cascading Style Sheets

Although each report procedure can link to only one external cascading style sheet (CSS), you can use several cascading style sheets to format a report by linking to one CSS that then imports several others. For information about importing one CSS into another, see your third-party CSS documentation.

Top of page

Editing an External Cascading Style Sheet

You can edit an external cascading style sheet (CSS) using a text editor or a third-party web development tool.

If the formatting of a report is specified entirely using a cascading style sheet, and you edit that CSS, the next time someone displays the report it will reflect the changes to the CSS without the report having to be rerun.

However, if the report does not reflect the changes, it may be because the web browser is continuing to use the old version of the CSS that it had stored in cache. The person displaying the report may need to reload the CSS file from the web server by clicking the Refresh button of the browser in Microsoft Internet Explorer to ensure that the browser uses the most current version of the CSS to format the report.

Top of page

Choosing a Cascading Style Sheet Rule

You can format different parts of a report using different types of rules.

To format:

Use a rule for:

The entire report


Any report component

A generic class (that is, one declared without an element)

To choose between using a rule for BODY or for TD, note that a rule for:

When you use a rule for a class to format a report component, you must assign the class to the component in a WebFOCUS StyleSheet using the CLASS attribute, as described in How to Use the CLASS Attribute to Apply CSS Formatting.

If you wish to apply several CSS properties to a single report component, we recommend that you declare them in a single class. This generates more efficient output than does declaring one property per class.

The owner of each cascading style sheet should consider making available a list of all the classes in that CSS that can be used to format reports, so that everyone who develops reports knows from which classes they may choose.

For an example of a rule for:

Top of page

Naming a Cascading Style Sheet Class

When you provide a name for a new class, note that class names are case-sensitive (although some web browsers may not enforce case sensitivity).

When you create a new class, we recommend naming it after the function, not the appearance, of the report component to which you will be applying it. This ensures that the name remains meaningful even if you later change the appearance of the report component. For example, if you want all report titles to be red, the class you declare to format titles might be named Title, but not Red.