In this section: |
How to: |
For a PDF, PS, or HTML report, you can use the POSITION attribute in a StyleSheet to specify a starting position for a heading or footing, expressed as a unit measurement. For HTML, this capability requires an internal cascading style sheet. For details on selecting an alignment method, see Choosing an Alignment Method for Heading and Footing Elements.
In addition, for a PDF or PS report, you can use the POSITION attribute to specify an absolute or relative starting position for an element within a heading or footing or to align an item in a heading or footing with a report column. An absolute starting position is the distance from the left margin of the report. A relative starting position is the distance from the preceding object. For the first item on a heading line this is the left margin of the report.
In an HTML report, you can use related syntax and an internal cascading style sheet to position an image in a heading or footing. For details on images, see Laying Out the Report Page.
Use the following syntax to specify a starting position for an entire heading or footing in relation to the left margin of a report.
TYPE = headfoot, POSITION = position, $
where:
Note: In an HTML report, this syntax must be used in conjunction with an internal cascading style sheet.
This request positions the report heading 1.25 inches from the left margin.
SET ONLINE-FMT=PDF TABLE FILE GGSALES PRINT BUDDOLLARS DOLLARS BY STCD WHERE BUDDOLLARS GE 25000 WHERE STCD EQ 'R1019' ON TABLE SUBHEAD "Sales Report" " " ON TABLE SET PAGE-NUM OFF ON TABLE SET SQUEEZE ON ON TABLE SET STYLESHEET * TYPE = TABHEADING, POSITION = 1.25, $ ENDSTYLE END
The output is:
The request generates an internal cascading style sheet as part of its HTML code, enabling the use of the POSITION attribute to specify a starting position for the heading, Sales Report, 1.5 inches from the left margin.
SET ONLINE-FMT = HTML TABLE FILE GGSALES PRINT BUDDOLLARS DOLLARS BY STCD WHERE BUDDOLLARS GE 25000 WHERE STCD EQ 'R1019' ON TABLE SUBHEAD "Sales Report" " " ON TABLE SET PAGE-NUM OFF ON TABLE SET HTMLCSS ON ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ TYPE = TABHEADING, POSITION = 1.5, $ ENDSTYLE END
The output is:
For a PDF or PS report, use the following syntax to specify a starting position for a heading or footing element in relation to the preceding item
TYPE = headfoot, [subtype,] POSITION = {+|-}option, $
where:
Is the type of heading or footing. Valid values are TABHEADING, TABFOOTING, HEADING, FOOTING, SUBHEAD, and SUBFOOT.
Are additional attributes that identify the report component. These options can be used separately or in combination, depending upon the degree of specificity you need to fully identify an element. Valid values are:
If a heading or footing has multiple lines and you apply a StyleSheet declaration that does not specify LINE, the declaration is applied to all lines. Blank lines are counted when interpreting the value of LINE.
To determine an ITEM number for an OBJECT, follow these guidelines:
If you apply a StyleSheet declaration that specifies ITEM, the number is counted from the beginning of each line in the heading or footing, not just from the beginning of the first line.
It is not necessary to specify OBJECT=TEXT unless you are styling both text strings and embedded fields in the same heading or footing.
Is the alignment method. Valid values are:
This request uses the spot marker <+0> to divide the report heading into three text strings. It starts the third text string, 1st Qtr 2001, 3 inches from the left report margin. This technique can be used in PDF as well as PS reports.
SET ONLINE-FMT = PDF TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE SUBHEAD "Sales Report - <+0>All Products<+0> 1st Qtr 2001" " " ON TABLE SET PAGE-NUM OFF ON TABLE SET SQUEEZE ON ON TABLE SET STYLESHEET * TYPE = TABHEADING, OBJECT = TEXT, ITEM=1, SIZE = 12, STYLE = BOLD, $ TYPE = TABHEADING, OBJECT = TEXT, ITEM=2, STYLE = BOLD, $ TYPE = TABHEADING, OBJECT = TEXT, ITEM=3, POSITION = 3, $ ENDSTYLE END
The output is:
This request uses the spot marker <+0> to divide the report heading into three text strings. It starts the third text string, 1st Qtr 2001, one inch to the right of the previous item on the heading line. Inches is the default unit of measure. This technique can be used in PDF as well as PS reports.
SET ONLINE-FMT = PDF TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE SUBHEAD "Sales Report - <+0>All Products<+0> 1st Qtr 2001" " " ON TABLE SET PAGE-NUM OFF ON TABLE SET SQUEEZE ON ON TABLE SET STYLESHEET * TYPE = TABHEADING, OBJECT = TEXT, ITEM=1, SIZE = 12, STYLE = BOLD, $ TYPE = TABHEADING, OBJECT = TEXT, ITEM=2, STYLE = BOLD, $ TYPE = TABHEADING, OBJECT = TEXT, ITEM=3, POSITION = +1, $ ENDSTYLE END
The output is:
This request uses the spot marker <+0> to divide the report heading into three text strings. It starts the second text string at the horizontal position where the column UNITS (Unit Sales) is. This technique can be used in PDF as well as PS reports.
SET ONLINE-FMT = PDF TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE SUBHEAD "Sales Report - <+0>All Products<+0> 1st Qtr 2001" " " ON TABLE SET PAGE-NUM OFF ON TABLE SET SQUEEZE ON ON TABLE SET STYLESHEET * TYPE = TABHEADING, LINE=1, ITEM=2, POSITION=UNITS, $ ENDSTYLE END
The output is:
Tip: In this request the column (UNITS) is identified by name. However, there are other ways to identify a column that you wish to format. See Identifying a Report Component in a WebFOCUS StyleSheet.
How to: |
PRINTPLUS includes enhancements to display alternatives offered by WebFOCUS. For example, you can place a FOOTING after a SUBFOOT in your report. PRINTPLUS provides the flexibility to produce the exact report you desire.
The PRINTPLUS parameter must be set to ON to use the following TABLE capabilities:
Note: PRINTPLUS is not supported for StyleSheets. A warning message is generated in this case.
Issue the command
SET PRINTPLUS = {ON|OFF}
With PRINTPLUS on, the SUBFOOT prints first, followed by the FOOTING.
SET PRINTPLUS = ON TABLE FILE CAR PRINT CAR MODEL BY SEATS BY COUNTRY IF COUNTRY EQ ENGLAND OR FRANCE OR ITALY ON TABLE SUBFOOT " " " SUMMARY OF CARS IN COUNTRY BY SEATING CAPACITY" FOOTING " RELPMEK CAR SURVEY " ON TABLE SET STYLE * TYPE=REPORT,GRID=OFF,$ ENDSTYLE END
The output is:
SEATS |
COUNTRY |
CAR |
MODEL |
----- |
------- |
— |
----- |
2 |
ENGLAND |
TRIUMPH |
TR7 |
ITALY |
ALFA ROMEO |
2000 GT VELOCE |
|
ALFA ROMEO |
2000 SPIDER VELOCE |
||
MASERATI |
DORA 2 DOOR |
||
4 |
ENGLAND |
JAGUAR |
V12XKE AUTO |
JENSEN |
INTERCEPTOR III |
||
ITALY |
ALFA ROMEO |
2000 4 DOOR BERLINA |
|
5 |
ENGLAND |
JAGUAR |
XJ12L AUTO |
FRANCE |
PEUGEOT |
504 4 DOOR |
|
SUMMARY OF CARS IN COUNTRY BY SEATING CAPACITY |
|||
RELPMEK CAR SURVEY |
You can employ several types of spot markers to refine the positioning of headings and footings, and elements within them, in HTML and PDF reports that use proportional fonts. For maximum control, you can combine spot markers with other alignment techniques. See Choosing an Alignment Method for Heading and Footing Elements.
The following spot markers enable you to position items and to identify items to be formatted:
To divide a heading or footing into items that can be formatted separately, place the <+0> spot marker after the text string or field you wish to specify. It will not add any additional spaces to your heading or footing. For details, see Identifying a Report Component in a WebFOCUS StyleSheet.
To specify skipped lines in a heading or footing, place the </n> spot marker on the same line as the text in the request. If you place it on a line by itself, WebFOCUS counts the line the spot marker is on plus the number of skip-lines you designate. For details, see Controlling the Vertical Positioning of a Heading or Footing.
Note: When a closing spot marker is immediately followed by an opening spot marker (><), a single space text item will be placed between the two spot markers (> <). This must be considered when applying formatting.
You can also use spot markers to position heading and footing elements at fixed and relative column locations. Several spot markers control positioning based on the pre-defined width of a character in a monospace font. This is a legacy formatting technique that is not supported for proportional fonts.
This request generates an HTML report in which the closing parenthesis and the period in the sort heading follow immediately after the STORE_CODE and STATE fields, respectively. This behavior is controlled by the <-1 spot markers, which indicate a relative starting position from the preceding object. Without these spot markers to indicate that the punctuation characters should follow the preceding objects, an extra space would appear in each of these positions in the display.
SET ONLINE-FMT = HTML SET PAGE-NUM = OFF JOIN STORE_CODE IN CENTCOMP TO STORE_CODE IN CENTORD
TABLE FILE CENTCOMP HEADING "Century Corporation Orders Report </1" PRINT PROD_NUM QUANTITY LINEPRICE BY STORE_CODE NOPRINT BY ORDER_NUM ON STORE_CODE SUBHEAD "Century Corporation orders for store <STORENAME <0X (store # <STORE_CODE<-1 ) in <STATE|.</1" ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The partial output is:
In a PDF report, an embedded field in a heading or footing must be followed by a space in the request to be recognized for processing. However, in the output the space may not be desirable. This example demonstrates two techniques for positioning punctuation characters immediately after a field in a PDF report.
The first technique uses the POSITION attribute in a StyleSheet to position the closing parenthesis immediately after the STORE_CODE value. The second technique uses the <-1 spot marker to position the period immediately after the STATE value. The POSITION measurement is based on the UNITS designation POINTS. Experimentation demonstrated that -7 points moves the closing parenthesis to the proper location after the field, using the default proportional font and size.
SET ONLINE-FMT = PDF SET PAGE-NUM = OFF JOIN STORE_CODE IN CENTCOMP TO STORE_CODE IN CENTORD TABLE FILE CENTCOMP HEADING "Century Corporation Orders Report" PRINT PROD_NUM QUANTITY LINEPRICE BY STORE_CODE NOPRINT BY ORDER_NUM ON STORE_CODE SUBHEAD "Century Corporation orders for store <STORENAME (store # <STORE_CODE ) in <0X <STATE <-1 . </1" ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, UNITS=POINTS, $ TYPE=SUBHEAD, OBJECT=TEXT, ITEM=3, POSITION= -7, $ ENDSTYLE END
The output is:
Without the spot marker and position measurement, the output would have looked like this:
This request uses a 12-point Helvetica font. Experimentation demonstrated that the POSITION value of -2 moves the text in this font and size to the required position.
SET ONLINE-FMT = PDF SET PAGE-NUM = OFF JOIN STORE_CODE IN CENTCOMP TO STORE_CODE IN CENTORD TABLE FILE CENTCOMP HEADING "CENTURY CORPORATION ORDERS REPORT" PRINT PROD_NUM QUANTITY LINEPRICE BY STORE_CODE NOPRINT WHERE STORE_CODE EQ '1003NY' OR '1003CT' OR '1003NJ' BY ORDER_NUM ON STORE_CODE SUBHEAD "CENTURY CORPORATION ORDERS FOR STORE <STORENAME (store # <STORE_CODE)<0X IN <STATE <-1 . </1" ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, UNITS=POINTS, FONT='Helvetica', SIZE=12, $ TYPE=SUBHEAD, OBJECT=TEXT, ITEM=3, POSITION= -2, $ ENDSTYLE END
Tip: You cannot use the POSITION attribute to position a heading element in an in HTML report. However, you can achieve the same result by placing the horizontal spot markers <-1 immediately after the fields STORE_CODE and STATE. Do not add a space between the field and the character that will follow it.
The output is: