Creating a WebFOCUS StyleSheet

In this section:

You can create a StyleSheet:


Top of page

x
Creating a WebFOCUS StyleSheet Within a Report Request

How to:

You can create a StyleSheet within a report request. This enables you to create and maintain the formatting for your report directly in the report request. This type of StyleSheet is known as an inline StyleSheet.



x
Syntax: How to Create a WebFOCUS StyleSheet Within a Report Request
ON TABLE SET STYLE[SHEET] * 
declaration 
[declaration]
.
.
.
[ENDSTYLE]

where:

SHEET
Can be omitted to make the command shorter, and has no effect on its behavior.
declaration
Is a StyleSheet declaration. StyleSheet declarations usually specify the report component you want to format and the formatting you want to apply. For more information about declarations, see General WebFOCUS StyleSheet Syntax.
ENDSTYLE
Indicates the end of an inline StyleSheet. You can omit ENDSTYLE if it is followed immediately by END in the report request.


Example: Creating a WebFOCUS StyleSheet Within a Report Request

The following illustrates an inline StyleSheet. The StyleSheet is highlighted in the request.

TABLE FILE GGSALES
SUM UNITS DOLLARS BY CATEGORY BY PRODUCT
HEADING
"Sales Report"
FOOTING CENTER
"**End of Report**"
ON TABLE SET PAGE-NUM OFF 
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=HEADING, FONT=ARIAL, SIZE=12, STYLE=BOLD, $
TYPE=TITLE, STYLE=ITALIC, $
TYPE=DATA, COLUMN=N1, STYLE=BOLD, COLOR=BLUE, $
TYPE=FOOTING, COLOR=RED, STYLE=BOLD, $
ENDSTYLE
END

The output is:


Top of page

x
Creating and Applying a WebFOCUS StyleSheet File

How to:

Reference:

You can create a StyleSheet as a separate file and apply it to as many reports as you wish. A StyleSheet file contains declarations and optional comments and nothing else (unlike an inline StyleSheet, it does not contain the ON TABLE SET STYLESHEET and ENDSTYLE commands). You can apply a StyleSheet file to a report using the SET STYLESHEET command, as described in How to Apply a WebFOCUS StyleSheet File to a Report. For information about StyleSheet declarations, see General WebFOCUS StyleSheet Syntax.

As an alternative to creating a StyleSheet file from scratch, you can copy one of the sample StyleSheet files provided with WebFOCUS and Developer Studio to use as a template. The sample StyleSheet files are described in Sample WebFOCUS StyleSheet Files.

Whether you create a StyleSheet file from scratch or copy and customize an existing one, you need to store it in the correct location, as described in Naming and Storing a WebFOCUS StyleSheet File.

After you have created a StyleSheet file, you can check it for syntax errors using the CHECK STYLE command, as described in Validating WebFOCUS StyleSheet Syntax.



x
Reference: Naming and Storing a WebFOCUS StyleSheet File

When you create a StyleSheet file to be used in:

You should name a StyleSheet file filename.sty, where filename can include letters, numbers, and underscores (_), and otherwise must be valid for the operating environments on which it resides.



x
Syntax: How to Apply a WebFOCUS StyleSheet File to a Report

To apply your StyleSheet file at the beginning of your report request, use

SET STYLE[SHEET] = stylesheet

To apply your StyleSheet file within your report request use

ON TABLE SET STYLE[SHEET] stylesheet

where:

SHEET
Can be omitted to make the command shorter, and has no effect on its behavior.
stylesheet
Is the name of the StyleSheet file. Do not include the file extension.


x
Reference: Sample WebFOCUS StyleSheet Files

Many sample StyleSheet files are available in Developer Studio in the ibi\devstudio#\bin directory (where # is the release number). For example, use ibi\devstudio77\bin for Release 7.7.

You can apply any of these sample StyleSheets directly to a report, or you can use them as templates to create your own customized StyleSheets. If you use them as templates, be sure to make a copy of the original file and edit the copy, leaving the original unchanged.

The following is a list of the file names for the sample StyleSheets available in the Report Painter and Report Assistant:

altbycol.sty

deflt4.sty

proslate.sty

basicyel.sty

defltblu.sty

sales.sty

blackred.sty

elephant.sty

slate.sty

boyscout.sty

eursteel.sty

soupcan.sty

citrus.sty

fclabels.sty

sports.sty

classic.sty

fuschia.sty

teal.sty

corporat.sty

greenbar.sty

usa.sty

deflt.sty

marble.sty

usasty.sty

deflt1.sty

olive.sty

wood.sty

deflt2.sty

paper.sty

yankee.sty

deflt3.sty

problue.sty

 

WebFOCUS