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

x
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

x
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

x
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

x
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

x
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

BODY or TD

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

x
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.


WebFOCUS