In this section: |
Reference: |
A report consists of several components, each of which can you can format or style. WebFOCUS App Studio is installed with a set of StyleSheet files, each of which has a distinctive theme. You can select one of these themes for your output and you can customize selected report components individually. You can create your own styles or use the themes included with WebFOCUS App Studio.
Using a styling theme is an excellent way to easily style many different aspects of a report, for example, headings, footings, column titles, backgrounds, fonts, grids, borders, images, and so on. Many companies apply standard style themes to their reports so all of their reports look consistent and professional.
A style theme, once it is applied to a report, is used every time the report is run. If you want to display some of the data differently, you can customize individual styles either for all data or for data that satisfies specific criteria (called conditional styling).
The physical characteristics of a style for a report component consist of the following basic attributes:
How to: |
A StyleSheet describes how you want your report to look. You can create a StyleSheet within a report request (useful when you are applying a set of styles to only one report) or as a separate file (useful when you want to create a StyleSheet theme that you can apply to any report). In addition, you can create a StyleSheet on one platform and then port it to, and run it on, other platforms.
You use the Style group, on the Report tab, to apply stylistic changes to a report, including data, title, and all other components of the report. The commands are:
A StyleSheet consists of a set of declarations, which:
In your StyleSheet, you only need to include declarations for those components whose format you want to change. Within each declaration, you only need to include those attributes you want to change.
Each declaration in a StyleSheet consists of attribute=value pairs separated by commas, and terminated with a comma and dollar sign (,$). The syntax is:
TYPE=component, attribute=value, ... ,$
For example:
TYPE=Report, FONT=Times, SIZE=10, $ TYPE=Data, COLUMN=REVENUE_US, BACKCOLOR=Aqua, COLOR=Navy, STYLE=Bold, WHEN=REVENUE_US GT 500, $ TYPE=Title, FONT='Helvetica', $ TYPE=Heading, FONT='Helvetica', STYLE=Bold, SIZE=14, JUSTIFY=Center, BACKCOLOR=Dark Turquoise, COLOR=White, $ TYPE=Heading, LINE=6, BACKCOLOR=White, COLOR=Dark Turquoise,$
The following procedure shows you how to change the default style to a predefined theme.
The Report Wizard opens.
The Select Data Source window opens.
The Report canvas opens.
The following request applies the enblue_light1 theme to the report output. The ON TABLE SET STYLE * and ENDSTYLE commands indicate the beginning and the end of an inline StyleSheet.
TABLE FILE WF_RETAIL SUM REVENUE_US BY FULLNAME BY PRODUCT_NAME ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = enblue_light1, $ ENDSTYLE END
You can use the following commands in a report request to create a StyleSheet to indicate the beginning and the end of an inline StyleSheet:
ON TABLE SET STYLE * . . . ENDSTYLE
For example, in the following report request, the StyleSheet syntax appears in bold.
TABLE FILE WF_RETAIL SUM REVENUE_US BY FULLNAME BY PRODUCT_NAME ON TABLE SET STYLE * TYPE=REPORT, FONT=ARIAL, SIZE=10, $ TYPE=REPORT, COLUMN=REVENUE_US, COLOR=RED, $ TYPE=REPORT, COLUMN=FULLNAME, COLOR=BLUE, $ TYPE=REPORT, COLUMN=PRODUCT_NAME, COLOR=GREEN, $ ENDSTYLE END
The request produces the following report, in which the font for the entire report is Arial 10, the Full Name column is blue, the Product Name column is green, and the Revenue column is red.
How to: |
You can conditionally format report components or display a graphic in your report based on the values in your report. Using conditional styling, you can:
This procedure shows how you can use the Traffic Lights feature to apply styling in your report based on conditions that you define. You can apply the styling either to an entire row, or to column data only. This example will use a red background to highlight revenue column data amounts that are less than 500.
The Report Wizard opens.
The Report Wizard - Select Procedure Location window opens.
The Select Data Source window opens.
The Report canvas opens.
Note: The Traffic Lights group in the Appearance tab is used to highlight column data only. To highlight an entire row, use the Traffic Lights group in the Reports tab instead.
The Condition List dialog box opens.
The Edit Condition dialog box opens. In the Condition field, a default name COND0001 is specified for your new condition, which you can change as required.
You are returned to the Condition List dialog box. Notice that the new condition COND0001 is now listed.
Note that the red background displays as a preview in the Report canvas when COND0001 is selected.
The example above shows conditional styling applied to the column data only, because the Traffic Lights group in the Appearance tab was used. To highlight the entire row, use the Traffic Lights group in the Reports tab instead.
This request sets conditional styling to use a red background to highlight revenue amounts that are less than 500.
TABLE FILE WF_RETAIL SUM REVENUE_US BY FULLNAME BY PRODUCT_NAME ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt,$ TYPE=DATA, COLUMN=REVENUE_US, WHEN=REVENUE_US LT 500, BACKCOLOR='RED' ,$ ENDSTYLE END
The following chart lists all report components that you can style.
TYPE |
Report Component |
---|---|
REPORT |
The entire report. |
PAGENUM |
Default page numbers. |
TABHEADING |
A heading on the first page of a report. |
TABFOOTING |
A footing on or after the last page of a report. |
HEADING |
Headings at the top of each report page. |
FOOTING |
Footings at the bottom of each report page. |
SUBHEAD |
Headings before a particular sort field. |
SUBFOOT |
Footings after a particular sort field. |
DATA |
Report data. |
TITLE |
Column titles. |
ACROSSTITLE |
ACROSS field names (that is, field names used in ACROSS phrases). |
ACROSSVALUE |
ACROSS field values (that is, values of the ACROSS field). |
SUBTOTAL |
Totals generated by SUBTOTAL, SUB-TOTAL, RECOMPUTE, and SUMMARIZE. |
GRANDTOTAL |
The last total on a report, which can either be a column total generated by COLUMN-TOTAL or a grand total generated by SUBTOTAL, SUB- TOTAL, RECOMPUTE, or SUMMARIZE. |
RECAP |
Lines generated by ON field name RECAP or ON field name COMPUTE. |
UNDERLINE |
Underlines generated by ON field name UNDER-LINE. |
SKIPLINE |
Skipped lines generated by ON field name SKIP-LINE. |
FREETEXT |
FML free text. |