Applying Predefined Style Sheets to a Report

In this section:

In Developer Studio, you can use the Report Painter to set styling options. For more information, see the Creating Reporting Applications With Developer Studio manual. The remainder of this section applies to the browser, unless indicated otherwise.

In the browser, Report Assistant enables you to set various styling options to enhance the look of your report. From Report Assistant, you can set the styling for the font, font style, font size, text color, and text background color for the following report components:

Make your styling selections from the Report Assistant Style dialog boxes. Access the Style dialog boxes, as follows:

Style Dialog Box

Access

Styles for Field

From the Field Options dialog box, select a field and click Field.

Styles for All Fields

From the Field Options dialog box, click All Fields.

Font (Conditional Styling)

From the Conditional Styling dialog box, define a condition, then click Font.

Report Style

From the Report Options tab, click Report Style.

Note: You can also style Headings and Footings from the Headings tab in Report Assistant. You can use the toolbar to set font properties, text and background color.

Each Style dialog box displays the customizable styling options you can set for that report component and the Style Example dialog box. The Style Example dialog box reflects the current style settings for the report component. As you make your styling selections, Report Assistant creates a style sheet that it applies to the report. A style sheet is a special set of instructions generated by Report Assistant to control the styling of the report.

You can select a predefined WebFOCUS StyleSheet or a Cascading Style Sheet from Report Assistant, instead of applying custom styling. A predefined StyleSheet or a Cascading Style Sheet is a style sheet that a WebFOCUS Administrator creates or imports and stores in a WebFOCUS domain Other Files folder. Any user who then accesses Report Assistant from the domain can apply the style sheet to their report.

You apply a style sheet to a report from the Report Options tab in the Report Assistant. The following image shows the Global report styling section of the Report Options tab. This field contains the Font button, active report Styling button, and the drop-down list boxes Apply an existing WebFOCUS Style Sheet and Apply an existing Cascading Style Sheet.

The Global report styling section

To apply an existing style sheet to a report, select a style sheet from the drop-down list. The drop-down list includes all style sheet files stored in the domain.

If you apply a predefined style sheet to a report, Report Assistant disables all customizable styling options and does not apply any previous styling selections for the entire report. These settings are not lost. If you decide not to apply the predefined style sheet, Report Assistant restores the report original styling settings and allows you to further customize styling a report.



x
Adding a Style Sheet to a Domain in the Browser or Developer Studio

To make predefined style sheets available from Report Assistant, an Administrator must add one or more StyleSheet files (.sty) or Cascading Style Sheets (.css) to a Other Files component of the domain. You add a style sheet file to this component in the following ways:

In the browser, Report Assistant lists the style sheet descriptions (not the actual file name) stored in the Other Files component in the predefined style sheet drop-down list.



Example: Using a CSS File

The following is an example of the contents of a .css file located in the Other Files of a Managed Reporting domain. The .css file may be created using the editor or by importing it into Managed Reporting:

BODY {BACKGROUND-COLOR: BLUE;}
TD {COLOR: YELLOW;}

Selecting Apply an existing Cascading Style Sheet for this .css file will generate the following syntax:

-* Created by Report Assistant
-* FF Line do not change this line! Field Name
-* FF Line do not change this line! Alias
-* FF Line do not change this line! Format
-* FF Line do not change this line! Segment
-* FF Line do not change this line! Colno
TABLE FILE CAR
SUM COUNTRY RETAIL_COST CAR
ON TABLE SET STYLE *
CSSURL=app/bodyblue.css, $
ENDSTYLE
END
-* End Report Assistant


Example: Using a WebFOCUS Style Sheet File With a CSS Reference

The following is an example of the contents of a WebFOCUS Style Sheet File (class.sty) located in the Other Files folder of a Managed Reporting domain. The class.sty file may be created using the editor or by importing it into Managed Reporting:

CSSURL=http://hostname[:port]/ibi_html/format.css ,$
TYPE=DATA, COLUMN=COUNTRY, CLASS=italcol ,$
TYPE=DATA, COLUMN=COUNTRY, SIZE=12, COLOR=YELLOW ,$

The format.css file contains the following format values:

BODY {BACKGROUND-COLOR: BLUE;}
.columntitle {font-family: helvetica; font-weight: bold; color: blue;}
.italcol {font-style: italic}
.12pt {font-size: 12pt;}
.bfield {font-weight: bold;}

Top of page

x
Predefined Style Sheet Syntax in the Browser

When you or a user applies a predefined style sheet to a report, Report Assistant generates the following syntax and appends it to the report:

ON TABLE SET STYLE *
-INCLUDE stylesheet.sty or stylesheet.css 
END

where:

stylesheet.sty

Indicates the StyleSheet selected from the predefined WebFOCUS StyleSheet drop-down list.

stylesheet.css

Indicates the Style Sheet selected from the predefined Cascading Style Sheet drop-down list.



Example: Applying a Predefined Style Sheet to a Report in the Browser

Before a user can apply a predefined style sheet to a report, a WebFOCUS Managed Reporting Administrator must add style sheet files to an Other File component of the domain.

  1. Open Report Assistant.
  2. If you are creating a new report, use the Field selection tab to add fields to your report.
  3. Click the Report Options tab.
  4. Click the Apply an Existing WebFOCUS Style Sheet or Apply an Existing Cascading Style Sheet check box.

    Report Assistant disables all customizable styling options.

  5. Select the predefined style sheet you want to apply to the report from the respective drop-down list.
  6. To check the output generated by your selections, click Run from any tab.

    WebFOCUS opens a new browser window displaying the report output. Close this window to return to Report Assistant.

  7. To accept the current Report Assistant settings, click Save from any tab.
  8. If you created a new report, you are prompted to enter a descriptive name for the report in the Save dialog box, then click OK to store the report in the domain.


Example: Working With Predefined Style Sheets

An Administrator has created the Sales domain and added the Inventory Report Style, Sales Report Style, and Purchasing Report Style StyleSheets to the Other Files component. As part of company report style guidelines, any user who creates an inventory, sales, or purchasing report must apply the associated StyleSheet to the report. Applying the appropriate StyleSheet ensures that reports of the same category have the same styling.

The following image shows the Sales domain with the Other Files subfolder expanded to display the Inventory Report Style, Purchasing Report Style, and Sales Report Style style files. (Style files will be available to end users when the Show as Predefined Style property is selected.)

When you develop a report or Reporting Object, you can select the required styling. For example, from the Reporting Objects Sales Report Templates subfolder, right-click the Product Unit Sales reporting object and select Open. The Reporting Object tool opens displaying the Reporting Object components. Select the Report component and click Open, as shown in the following image.

The Report Assistant tool opens. In Report Assistant, select the Report Options tab. In the Global report styling pane at the bottom of Report Assistant, select Sales Report Style from the Apply an existing WebFOCUS StyleSheet drop-down list, as shown in the following image. Note that the drop-down list contains the style sheets from the Other Files component of the domain.

When the user runs the report, WebFOCUS applies the predefined style sheet to the report and the output generated is consistent with your corporate standards.


WebFOCUS