Techniques for Quick and Easy Formatting
You can apply several formatting
techniques to save yourself time and effort. Most of these techniques
enable you to use code provided for you by WebFOCUS, or to leverage
code that you write yourself:
Inheritance and overrides. Each
report component inherits StyleSheet attributes from its "parent"
report component. This powerful feature lets you define common formatting
in a single declaration for a parent component, and lets descendant
components automatically inherit the formatting, while enabling
you to override the inherited values when you wish. By designing
your StyleSheet to take advantage of inheritance, you can write
less code and can quickly update formatting for multiple report
For example, if you declare all the report data to
be blue, all data in all columns will be displayed as blue. If you
also declare all vertical sort (BY) columns to be orange, this will
override the blue for sort columns, which will be displayed as orange.
If you also declare the EMP_ID sort column green, it will override
the orange and be displayed as green. For more information, see WebFOCUS StyleSheet Attribute Inheritance.
you are going to specify the same attribute and value in several
declarations in a StyleSheet, you can create a "macro" that enables
you to apply the attribute repeatedly throughout the StyleSheet
without coding it each time. Then, if you ever need to change the
value, you can change it once (in the macro), and have the change
applied automatically throughout the StyleSheet.
if there are several parts of a report that you wish to emphasize
(such as, titles of important columns, data values that exceed a
threshold, and sort headings), and you want all of these to be bold
and purple, you could define a macro that sets font style to bold
and color to purple, and then apply the macro to all of these report
components. For more information, see Reusing WebFOCUS StyleSheet Declarations With Macros.
can use Report Painter to generate most formatting code in a procedure.
In some cases, you can generate formatting code with Report Painter
and then edit it manually to take advantage of special code-based
formatting techniques. (Note that in a few cases, after you manually
edit generated code, you may not be able to reopen it in the tool
that generated it, though you will always be able to edit it manually.)
For more information about formatting reports using Report Painter,
see the Creating Reports With Report Painter manual.
Studio comes with several sample StyleSheets. You can apply one
of these samples to a report. You can also use a sample as a template, first
copying it and then customizing the copy. You can find sample StyleSheets
in the ibi\DevStudio77\srvnn\home\etc directory, where nn is
the server release. They are also listed in Report Painter (in the
Style tab of the Report Options dialog box).
WebFOCUS StyleSheet attributes have default values. Instead of explicitly
specifying every StyleSheet attribute, you can omit some and accept their
defaults. For example, you can accept the default font instead of
specifying a font. You can find each default value of an attribute
documented where its syntax is described.