Features Added in FOCUS 7.6.12

In this section:

FOCUS 7.6.12 provides several new styling options for PDF report output. In reports that use the OVER phrase to create multiple lines, you can align fields and headings and wrap columns and ACROSS values. In addition, you can repeat headings on panels, add grids to headings and footings, and make the lengths of subheading and subfooting lines match the lengths of page headings and page footings.


Top of page

x
Enhanced Alignment of Fields in Reports Using OVER in PDF Report Output

How to:

When columns are placed on report output, they are separated by gaps. You can control the size of the gaps between columns with the LEFTGAP and RIGHTGAP StyleSheet attributes.

By default, the gaps between columns are placed outside of the boundaries reserved for the fields on the report output. Therefore, the width or squeeze value defined for a field defines the size of the text area for the data value. It does not count the width of the gaps between columns. The bounding box used to define borders and background color is determined based on the data width plus the left gap plus the right gap.

Gaps external to the column boundaries must be accounted for when you try to align fields in reports that use the OVER phrase.

This enhancement, as well as some of the other enhancements, are designed to support the development of multi-row reports using blank AS names (column titles). Unless otherwise noted, these features work with non-blank titles, but they have not been designed to support alignment with non-blank column titles.

By default, column titles are placed to the left of the field values in a report using OVER. The OVER Title and the OVER Value each are measured by the combination of three parameters, LEFTGAP, WIDTH, and RIGHTGAP:

With OVER and blank AS names, each data value becomes a data cell that can be used to construct rows and columns within the data lines of the report. In order to align data values on a lower line with the columns above them, you must calculate widths for the lower level columns that take into account the widths of the data above them plus the widths of all of the left gaps and right gaps in between.

It can be complex to calculate how to size each column when aligning data and headings in reports using OVER. Each calculation of the column size must additionally account for the external left and right gap, and these gaps are cumulative as the number of columns on a given row increases.

Using the GAPINTERNAL=ON StyleSheet attribute, you can have the gaps placed within the column boundaries for PDF report output. This feature makes it much easier to align fields and headings in reports that use the OVER phrase to create multiple lines.

Note: OVER is now supported with SQUEEZE.



x
Syntax: How to Contol GAP Placement on Reports
TYPE=REPORT, GAPINTERNAL={OFF|ON}

where:

OFF

Places the left and right gaps outside the defined field width. OFF is the default value.

ON

Places the left and right gaps internal to the defined field width.



Example: Comparing External Gaps With Internal Gaps

With GAPINTERNAL=OFF, you must account for the accumulation of left and right gaps, as well as the field widths when defining widths of stacked columns.

With GAPINTERNAL=ON, the defined WIDTH represents the entire space used by the given data cell or column. This takes the cumulative effect out as the OVER values proceed across a row.



Example: Using GAPINTERNAL in a Report

The following request against the GGSALES data source places the PRODUCT field over the UNITS and DOLLARS fields and sets GAPINTERNAL to OFF:

SET LAYOUTGRID=ON
TABLE FILE GGSALES
"Product<+0>"
"Units<+0>Dollars"
SUM
PRODUCT AS ''
OVER
UNITS/D8C AS '' DOLLARS/D12.2CM AS ''
BY PRODUCT NOPRINT
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON, FONT=ARIAL, SIZE=8, LEFTMARGIN=1, TOPMARGIN=1,
 LEFTGAP=.1, RIGHTGAP=.1, GAPINTERNAL=OFF, $
TYPE=REPORT, BORDER=ON, $
TYPE=HEADING, BORDERALL=ON, $
TYPE=HEADING, LINE=1, ITEM=1, POSITION = PRODUCT, $
TYPE=HEADING, LINE=2, ITEM=1, POSITION = UNITS, $
TYPE=HEADING, LINE=2, ITEM=2, POSITION = DOLLARS, $
TYPE=REPORT, COLUMN=PRODUCT(2),   SQUEEZE=2,  $
TYPE=REPORT, COLUMN=UNITS, SQUEEZE=1, $
TYPE=REPORT, COLUMN=DOLLARS, SQUEEZE=1, $
END

The widths specified for UNITS and DOLLARS are one inch each, while the PRODUCT field is specified to be two inches. With GAPINTERNAL=OFF, the LAYOUTGRID shows that the widths used to place the columns are greater than the widths specified in the request. The additional space presented by the external leftgap and rightgap accounts for this effect:

The heading borders are aligned on the right of the report because of the SQUEEZE=ON attribute in the StyleSheet. Extra space was added to the report to align the headings. If you change the StyleSheet declaration for the PRODUCTS field to JUSTIFY=RIGHT, you can see that the extra space prevents the product value from aligning with the dollars value:

Changing the StyleSheet declaration to GAPINTERNAL=ON causes the specified widths to be used because the gaps are internal and are included in the specified values:

The following report output demonstrates that the values align properly even if the PRODUCT values are defined with JUSTIFY=RIGHT:


Top of page

x
Wrapping of Data Columns With OVER in PDF Report Output

How to:

Reference:

The WRAP StyleSheet attribute wraps data onto a new line when it does not fit within its defined column width. In prior releases, wrapping of data was not supported in columns that were placed within the report using the OVER phrase in a report request. Starting in Version 7.6 Release 12, FOCUS supports wrapping of columns placed on a new line with the OVER phrase for report output in PDF format.

OVER allows the presentation of a single data record across multiple lines within a report. By default, when OVER is defined within a request, the report shifts from a columnar presentation to a row level presentation. The field titles are displayed to the left of each value rather than at the top of each column. This layout was not designed to be aligned in any specific fashion but to allow for the presentation of multiple elements of data within a small area.

FOCUS Version 7.6 Release 12 includes a series of enhancements designed to support the development of multi-row reports using blank AS names. Unless otherwise noted, these features work with non-blank titles, but they have not been designed to support alignment with non-blank column titles.



x
Syntax: How to WRAP Data in Report Columns With OVER

To control wrapping of text inside a report, use the following syntax within a StyleSheet.

TYPE=type, [subtype,] [WRAP=n,] $

where:

type

Is the report component you wish to affect, such as REPORT, HEADING, or TITLE.

subtype

Is any additional attribute, such as COLUMN, ACROSS, ITEM, and so on, that is needed to identify the report component that you are formatting.

n

Represents a specific numeric value for the column width. The value represents the measure specified with the UNITS parameter.



Example: Wrapping Columns With OVER

The following request against the GGPRODS data source places the column VENDOR_NAME on a new line with the OVER phrase. By default, wrap is turned off and must be defined explicitly within the StyleSheet:

TABLE FILE GGPRODS
PRINT SIZE UNIT_PRICE PACKAGE_TYPE OVER
VENDOR_NAME
BY PRODUCT_ID BY PRODUCT_DESCRIPTION
ON TABLE HOLD FORMAT PDF
END

The partial output is shown in the following image.

The following version of the request turns wrapping on and sets a column width of 1.5 for the VENDOR_NAME column, which has been placed on a new line because of the OVER phrase:

TABLE FILE GGPRODS
PRINT SIZE UNIT_PRICE PACKAGE_TYPE OVER
VENDOR_NAME
BY PRODUCT_ID BY PRODUCT_DESCRIPTION
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=VENDOR_NAME, WRAP=1.5,$
ENDSTYLE
END

The partial output shows that the VENDOR_NAME column now wraps. Notice that turning WRAP ON causes the OVER value, not the OVER TITLE, to wrap:



x
Reference: OVER With Blank Column Titles

When OVER fields are defined with blank AS names (the value of the title of the column is set to empty ' '), they can be used to build a report with multiple data lines that present in an aligned grid fashion.

In this type of report, the column titles are usually indicated by adding multiple corresponding lines to the page headings rather than using the default titles that display to the left of the column field values. To present OVER fields with unique titles that take advantage of these new alignment features, you can place the column titles in independent fields and include them as fields within the given request.



Example: Using OVER and WRAP With Blank AS Names

The following example demonstrates using OVER with blank AS names and WRAP to build a multi-data line report:

TABLE FILE GGPRODS
PRINT PACKAGE_TYPE AS '' SIZE  AS '' OVER
VENDOR_NAME AS '' 
BY PRODUCT_ID  AS '' 
BY PRODUCT_DESCRIPTION  AS ''
ON TABLE SUBHEAD
"Gotham Grinds"
"Products Details"
HEADING 
" Code <+0>Description<+0>Size  <+0>Package"
" <+0>Vendor"
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=ARIAL, SIZE=10, SQUEEZE=ON,$
TYPE=REPORT, COLUMN=PACKAGE_TYPE, SQUEEZE=.5 ,$
TYPE=REPORT, COLUMN=VENDOR_NAME, WRAP=1 ,$
TYPE=REPORT, BORDER=ON, $
TYPE=HEADING, LINE=1, ITEM=1, BORDER=ON, $
TYPE=HEADING, LINE=1, ITEM=2, BORDER=ON, POSITION=PRODUCT_DESCRIPTION,$
TYPE=HEADING, LINE=1, ITEM=3, BORDER=ON, POSITION=SIZE ,$
TYPE=HEADING, LINE=1, ITEM=4, BORDER=ON, POSITION=PACKAGE_TYPE, $
TYPE=HEADING, LINE=2, ITEM=1, BORDER=ON, $
TYPE=HEADING, LINE=2, ITEM=2, BORDER=ON, POSITION=PACKAGE_TYPE,$
ENDSTYLE
END

On the report output, the Package Type and Size have been placed over the vendor name. The page heading has the corresponding titles. In the heading, the titles Package and Size have also been placed over the title Vendor Name. Note that the vendor name data wraps to maintain the alignment.



x
Reference: OVER and WRAP With Non-Blank Column Titles

The width of both the column title and the column data for each OVER value is determined by the single SQUEEZE or WRAP value. The title will automatically size to the same width as the wrapped data column. If the column title is wider than the width defined for the column wrap, you can either define a smaller title or add your titles as OVER fields that can be sized independently.

The following examples demonstrate how to build a report with OVER and WRAP that has column titles longer than the designated WRAP size.



Example: Using OVER and WRAP With Column Titles

The following request defines two virtual fields to contain the column titles for the Product Name and Vendor Name fields. It then prints each virtual field next to its related data field and gives each a blank AS name. The first virtual field and data field are placed over the second virtual field and data field:

DEFINE FILE GGPRODS
TITLE_PROD/A20 = 'Product Description';
TITLE_VEND/A20 = 'Vendor Name';
END
TABLE FILE GGPRODS
PRINT TITLE_PROD AS '' PRODUCT_DESCRIPTION  AS '' OVER
TITLE_VEND AS '' VENDOR_NAME  AS '' 
BY PRODUCT_ID  AS '' 
ON TABLE SUBHEAD
"Gotham Grinds"
"Products Details"
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=ARIAL, SIZE=10, SQUEEZE=ON,$
TYPE=REPORT, COLUMN=TITLE_PROD , SQUEEZE=1.25 ,$
TYPE=REPORT, COLUMN=TITLE_VEND , SQUEEZE=1.25 ,$
TYPE=REPORT, COLUMN=PRODUCT_DESCRIPTION, WRAP=.75 ,$
TYPE=REPORT, COLUMN=VENDOR_NAME, WRAP=.75 ,$
TYPE=REPORT, BORDER=ON, $
ENDSTYLE
END

The output shows that the titles and data align properly.


Top of page

x
Wrapping ACROSS Field Values in PDF Report Output

How to:

In a request that uses ACROSS, the output displays each value of the ACROSS field above the set of data columns applicable to that ACROSS value.

If the ACROSS value is longer than the width of its columns, you can wrap the ACROSS value within the width of its underlying columns.

By default, the width of each ACROSS value group (the ACROSS value and the data columns within) is defined as the largest of either the sum of the width of the data columns or the largest ACROSS value for that group. With wrapping, the size of each ACROSS wrap will be defined by the width defined based on this rule including all data columns and any non-wrapped across fields.

The width of each ACROSS column for a given ACROSS group is defined as the length of the largest value for that ACROSS group. A single width is used for each group so in groups where the values are shorter than the longest value, you will see a larger right gap within the cell.

For reports containing multiple ACROSS fields, you can wrap individual ACROSS fields or all of them. Each designated value will wrap within the defined ACROSS group.



x
Syntax: How to Wrap ACROSS Values
TYPE=ACROSSVALUE, [ACROSS={fieldname|Nn|An}] WRAP={OFF|ON} ,$

where:

ACROSS

If you have a request with multiple ACROSS fields, you can identify each field using the ACROSS identifier. You only need to include the ACROSS identifier if you have multiple ACROSS fields in your request.

fieldname

Specifies a horizontal sort row by its field name.

Nn

Identifies a column by its position in the report. To determine this value, count vertical sort (BY) fields, display fields, and ROW-TOTAL fields, from left to right, including NOPRINT fields.

An

Specifies a horizontal sort row by its position in the sequence of horizontal sort rows. To determine this value, count horizontal sort (ACROSS) fields. Cannot be combined with a field name specification in the same StyleSheet.

OFF

Turns off wrapping of the ACROSS values. OFF is the default value.

ON

Turns on wrapping of the ACROSS values.



Example: Wrapping ACROSS Values in PDF Report Output

In the following request against the GGPRODS data source, VENDOR_NAME is an ACROSS field:

TABLE FILE GGPRODS
HEADING
" PRODUCT REPORT" 
" "
PRINT PRODUCT_ID UNIT_PRICE/D5
ACROSS VENDOR_NAME
BY SIZE
WHERE VENDOR_NAME GT 'B' AND VENDOR_NAME LT 'F'
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=REPORT, COLUMN=PRODUCT_ID, WIDTH=.25, $
TYPE=REPORT, COLUMN=UNIT_PRICE, WIDTH=.25, $
ENDSTYLE
END

As shown in the following image, the output is too wide for one panel because some of the ACROSS field values (vendor names) are longer than the sum of the product code and unit price columns under them.

The following version of the request wraps the ACROSS values (TYPE=ACROSSVALUE, WRAP=ON ,$):

TABLE FILE GGPRODS
HEADING
" PRODUCT REPORT" 
" "
PRINT PRODUCT_ID UNIT_PRICE/D5
ACROSS VENDOR_NAME
BY SIZE
WHERE VENDOR_NAME GT 'B' AND VENDOR_NAME LT 'F'
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=REPORT, COLUMN=PRODUCT_ID, WIDTH=.25, $
TYPE=REPORT, COLUMN=UNIT_PRICE, WIDTH=.25, $
TYPE = ACROSSVALUE, WRAP=ON,$ 
ENDSTYLE
END

The report now fits on one panel, as shown in the following image.


Top of page

x
Support for Repeated Headings and Footings on Panels in PDF Report Output

How to:

When the columns presented on PDF reports cannot be displayed on a single page, the pages automatically panel. Paneling places subsequent columns for the same page on overflow pages. These overflow pages are generated until the entire width of the report is presented, after which the next vertical page is generated with a new page number and its associated horizontal panels.

In order to make panels following the initial panel more readable, you can designate that heading elements from the initial panel should be repeated on each subsequent panel using the HEADPANEL=ON StyleSheet attribute.

When paneling occurs, if default page numbering is used, the page number presented will include both the page number and the panel number (for example, 1.1, 1.2, 1.3). Turning HEADPANEL on will also cause the panel designation to be included in TABPAGENO.

HEADPANEL can be designated for the entire report, causing all headings and footings to be replicated on the panelled pages. It can also be turned on for just individual headings, footings, subheadings, or subfootings.

HEADPANEL causes borders from the initial page to be replicated on the panelled pages. Additional control of subheading and subfooting borders can be gained through the use of ALIGN-BORDERS which allows for the designation that subitem borders should align with the body of the data rather than the page or report headings. For more information about using ALIGN-BORDERS with HEADPANEL, see Aligning Subheading and Subfooting Margins With the Report Body.



x
Syntax: How to Repeat Heading Elements on Panels
TYPE={REPORT|headfoot [BY=sortcolumn]}, HEADPANEL={ON|OFF}, $

where:

REPORT

Repeats all report headings, footings, page headings, page footings, subheadings, and subfootings.

headfoot

Identifies a heading or footing. Select from:

TABHEADING which is a report heading. This appears once at the beginning of the report and is generated by ON TABLE SUBHEAD.

TABFOOTING which is a report footing. This appears once at the end of the report and is generated by ON TABLE SUBFOOT.

HEADING which is a page heading. This appears at the top of every report page and is generated by HEADING.

FOOTING which is a page footing. This appears at the bottom of every report page and is generated by FOOTING.

SUBHEAD which is a sort heading. This appears at the beginning of a vertical (BY) sort group (generated by ON sortfield SUBHEAD).

SUBFOOT which is a sort footing. This appears at the end of a vertical (BY) sort group (generated by ON sortfield SUBFOOT).

BY

When there are several sort headings or sort footings, each associated with a different vertical sort (BY) column, this enables you to identify which sort heading or sort footing you wish to format.

If there are several sort headings or sort footings associated with different vertical sort (BY) columns, and you omit this attribute and value, the formatting will be applied to all of the sort headings or footings.

sortcolumn

Specifies the vertical sort (BY) column associated with one of the report sort headings or sort footings.

ON

Repeats the specified heading or footing elements on each panel.

OFF

Displays heading or footing elements on the first panel only. OFF is the default value.

Note that the HEADPANEL=ON attribute can only be applied to the entire heading or footing, not individual lines or items within the heading or footing.



Example: Repeating All Headings and Footings on Report Panels

The following request against the GGSALES data source sums units sold, budgeted units sold, dollar sales, and budgeted sales by region, state, city, category, and product. The report has a page heading and, for each region, a subfooting:

TABLE FILE GGSALES
HEADING
"PRODUCT SALES REPORT"
""
"Page<TABPAGENO"
""
SUM UNITS BUDUNITS DOLLARS BUDDOLLARS
BY REGION NOPRINT
BY ST BY CATEGORY BY PRODUCT
ON REGION SUBFOOT
" "
" SUBFOOT FOR REGION <REGION "
" SUBTOTAL BUDDOLLARS: <ST.BUDDOLLARS SUBTOTAL DOLLARS: <ST.DOLLARS "
" "
ON TABLE SET BYPANEL ON
ON TABLE SET PAGE ON
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE = REPORT, HEADPANEL=OFF,$
ENDSTYLE
END

The request sets BYPANEL ON, so each panel displays the sort field values. However, since HEADPANEL=OFF for the entire report, the first panel for page 1 has the heading and the subfooting, but the second panel does not.

The output for page 1 panel 1 has the heading and subfooting, as shown in the following image. Note that with HEADPANEL=OFF, TABPAGENO does not include the panel number:

The output for page 1 panel 2 does not have the heading or subfooting, as shown in the following image.

The following output shows panels 1 and 2 if the StyleSheet declaration is changed to set HEADPANEL=ON for the entire report (TYPE=REPORT, HEADPANEL=ON ,$). The heading and subfooting are repeated on each panel. With HEADPANEL=ON, TABPAGENO includes the panel number:



Example: Repeating a Subfoot on Panels in PDF Report Output

The following request against the GGSALES data source specifies the HEADPANEL=ON attribute only for the subfoot, not for the entire report. Notice that this request uses the default page numbering (ON TABLE SET PAGE ON) rather than TABPAGENO to present the page numbers on each page:

TABLE FILE GGSALES
HEADING
" PRODUCT SALES REPORT" 
" "
SUM UNITS BUDUNITS DOLLARS BUDDOLLARS
BY REGION NOPRINT
BY ST BY CITY  BY CATEGORY BY PRODUCT 
ON REGION SUBFOOT
" "
" SUBFOOT FOR REGION <REGION "
" SUBTOTAL BUDDOLLARS: <ST.BUDDOLLARS SUBTOTAL DOLLARS:  <ST.DOLLARS "
" "
ON TABLE SET BYPANEL ON
ON TABLE SET PAGE ON
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE = SUBFOOT, HEADPANEL=ON,$
 
ENDSTYLE
END

Panel 1 displays both the heading and the subfooting, as shown in the following image:

Panel 2 displays only the subfooting, not the heading, as shown in the following image.

Since the page heading is not repeated, if you use the <TABPAGENO system variable to place the page number in the heading, it will not display the panel number and will not display on the second panel:

TABLE FILE GGSALES
HEADING
" PRODUCT SALES REPORT PAGE <TABPAGENO" 
" "
SUM UNITS BUDUNITS DOLLARS BUDDOLLARS
BY REGION NOPRINT
BY ST BY CITY  BY CATEGORY BY PRODUCT 
ON REGION SUBFOOT
" "
" SUBFOOT FOR REGION <REGION "
" SUBTOTAL BUDDOLLARS: <ST.BUDDOLLARS SUBTOTAL DOLLARS:  <ST.DOLLARS "
" "
ON TABLE SET BYPANEL ON
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE = SUBFOOT, HEADPANEL=ON,$
 
ENDSTYLE
END

The first panel displays the page number in the heading, without the panel number, as shown in the following image.

The second panel does not display the heading and therefore, does not display the embedded page number, as shown in the following image:



Example: Repeating Styled Headings and Footings on Panelled Pages

The following request against the GGSALES data source has a report heading, a page heading with an image, a footing, a subheading, a subfooting, and a subtotal:

SET BYPANEL=ON
DEFINE FILE GGSALES
SHOWCATPROD/A30 = CATEGORY || ' / ' || PRODUCT;
END
TABLE FILE GGSALES
SUM 
     DOLLARS/I8M AS ''
BY REGION
BY ST
BY CITY
ACROSS SHOWCATPROD AS 'Product Sales'
     
ON REGION SUBHEAD
" "
"Subheading Region <REGION"
" "
ON REGION SUBTOTAL AS '*TOTAL'
ON REGION SUBFOOT WITHIN 
" "
"Subfooting Region <REGION"
" "
ON TABLE SUBHEAD
"Report Heading"
HEADING
"Page <TABPAGENO  "
" "
" "
" "
FOOTING
" "
"PAGE FOOTING "
ON TABLE SUBFOOT
" "
"Report Footing"
ON TABLE SET PAGE-NUM OFF 
ON TABLE HOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=9,
     HEADPANEL=ON,
     BORDER=ON,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=20,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=20,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=1,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     LINE=2,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     LINE=3,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     LINE=4,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     LINE=5,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     IMAGE=smplogo1.gif,
     POSITION=(+0.000000 +0.000000),
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
     JUSTIFY=RIGHT,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
     WRAP=ON,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END

Since HEADPANEL=ON for the entire report, both panels display all of the heading and footing elements.

The following image shows page 1 panel 1.

The following image shows page 1 panel 2.


Top of page

x
Alignment of Items With Data in Headings in PDF Report Output

How to:

To support the development of complex headings containing multiple individual cells, rows or columns, you can designate that each of the items in a heading element be aligned with columns in the body of your report. Using HEADALIGN = BODY within any heading element aligns each item in the heading with a column in the report. The report elements then define the width and placement of the column, and the corresponding heading item is automatically positioned. Additionally, each heading item can be tied to a single report column or defined to span across a series of adjacent data columns using the COLSPAN style sheet attribute.



x
Syntax: How to Align Heading or Footing Elements With Report Columns
TYPE = {REPORT|headfoot}, HEADALIGN = {BODY|NONE}, $

where:

REPORT

Applies the alignment to all heading and footing elements in a report.

headfoot

Is the type of heading or footing. Valid values are TABHEADING, TABFOOTING, HEADING, FOOTING, SUBHEAD, and SUBFOOT.

Note: HEADALIGN can only be defined for an entire heading element. It cannot be defined for individual lines or items within a heading element.

BODY

Aligns the specified heading or footing elements with the report body.

Note: HEADALIGN=BODY does not support paneling.

NONE

Does not align heading or footing elements with the report body. NONE is the default value.



Example: Aligning Subfooting Items With Report Columns in PDF Report Output

In the following request against the GGORDER data source, the subfooting has a text object ("Total") and a field object (ST.QUANTITY). The subfooting aligns the items with their report columns using TYPE=SUBFOOT, HEADALIGN=BODY, $. The text object is placed in the second report column using the <+0 spot marker, and the field object is placed in the third report column using another <+0 spot marker. Then the text item is left aligned (the default) with its report column. The field object is right aligned with its report column:

TABLE FILE GGORDER
PRINT QUANTITY
ORDER_NUMBER ORDER_DATE STORE_CODE 
BY PRODUCT_CODE BY PRODUCT_DESCRIPTION
WHERE ORDER_DATE EQ '01/01/96'
WHERE STORE_CODE EQ 'R1019' 
ON PRODUCT_CODE SUBFOOT
" <+0 Total: <+0 <ST.QUANTITY" 
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLESHEET *
TYPE = SUBFOOT,HEADALIGN=BODY, $
TYPE = SUBFOOT,OBJECT=TEXT,STYLE = BOLD, $
TYPE = SUBFOOT,OBJECT=FIELD,JUSTIFY=RIGHT,STYLE = BOLD, $
ENDSTYLE
END

The output shows that the text Total is aligned with the product names and the subtotal field object is right aligned with the Ordered Units column.



Example: Using OVER With HEADALIGN=BODY

When aligning heading elements with the data line using HEADALIGN=BODY, the first row of fields serves as the anchor data row. Each heading line contains the number of columns presented in the anchor data row. Any additional columns that may appear on other data lines are not presented. If the first row of data contains fewer data value cells than other data rows, you will be unable to add alignment columns within headings for these additional columns.

In the following example, the first row (the anchor data row) contains a single value. Items placed in headings to correspond with column two that appears on subsequent rows are not displayed.

SET LAYOUTGRID=ON
TABLE FILE GGSALES
"Product<+0>"
"Units<+0>Dollars"
SUM
PRODUCT AS ''
OVER
UNITS/D8C AS '' DOLLARS/D12.2CM AS ''
BY PRODUCT NOPRINT
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON,FONT=ARIAL, SIZE=8, LEFTGAP=.1, RIGHTGAP=.1, GAPINTERNAL=ON, LEFTMARGIN=1, $
TYPE=REPORT, BORDER=ON, $
TYPE=HEADING, BORDERALL=ON, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, ITEM=1, COLSPAN=2, WIDTH=2, JUSTIFY=LEFT, $
TYPE=HEADING, LINE=2, ITEM=1, WIDTH=1, JUSTIFY=LEFT, $
TYPE=HEADING, LINE=2, ITEM=2, WIDTH=1, JUSTIFY=LEFT, $
TYPE=REPORT, COLUMN=PRODUCT(2),   SQUEEZE=2,  $
TYPE=REPORT, COLUMN=UNITS, SQUEEZE=1, $
TYPE=REPORT, COLUMN=DOLLARS, SQUEEZE=1, $
END

The output shows that the heading lines have one column each, while the data lines alternate between one column and two columns:



x
Syntax: How to Align a Heading or Footing Element Across Columns
TYPE = headfoot, [subtype,] COLSPAN = n, $

where:

headfoot

Is the type of heading or footing. Valid values are TABHEADING, TABFOOTING, HEADING, FOOTING, SUBHEAD, and SUBFOOT.

subtype

Are additional attributes that identify the report component. These options can be used separately or in combination, depending upon the degree of specificity required to identify an element. Valid values are:

LINE which identifies a line by its position in a heading or footing. Identifying individual lines enables you to format each line differently.

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.

OBJECT which identifies an element in a heading or footing as a text string or field value. Valid values are TEXT or FIELD. TEXT may represent free text or a Dialogue Manager amper (&) variable.

It is not necessary to specify OBJECT=TEXT unless you are styling both text strings and embedded fields in the same heading or footing.

ITEM which identifies an item by its position in a line. To divide a heading or footing line into items, you can use the <+0> spot marker.

To determine the ITEM for an OBJECT, follow these guidelines:

  • When used with OBJECT=TEXT, count only the text strings from left to right.
  • When used with OBJECT=FIELD, count only values from left to right.
  • When used without OBJECT, count text strings and field values from left to right.

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.

COLSPAN

Is an attribute that aligns an item in the width spanned by multiple columns.

n

Is the column with which the specified item is aligned.



Example: Aligning a Field Value Across Multiple Columns

In this request, HEADALIGN=BODY aligns the sort footing in the same grid as the body of the report. COLSPAN=5 positions the first item in the sort footing (the text Total) in the fifth column of the report output. The second item in the sort footing (the field <ST.QUANTITY) is positioned in the next available column. The subfooting items are right justified.

The HEADALIGN attribute is on a separate line from the COLSPAN attribute because it applies to the entire sort footing (and consequently to both items), whereas COLSPAN applies only to the text item Total.

TABLE FILE GGORDER
PRINT ORDER_NUMBER ORDER_DATE STORE_CODE QUANTITY
BY PRODUCT_CODE BY PRODUCT_DESCRIPTION
WHERE ORDER_DATE EQ '01/01/96'
WHERE STORE_CODE EQ 'R1019'
ON PRODUCT_CODE SUBFOOT
"Total:<ST.QUANTITY"
""
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLESHEET *
TYPE=REPORT, FONT=ARIAL, SQUEEZE=ON,$ 
TYPE = SUBFOOT, HEADALIGN = BODY, JUSTIFY = RIGHT, STYLE = BOLD, $
TYPE = SUBFOOT, ITEM=1, COLSPAN = 5, $
ENDSTYLE
END

The output shows that the first item in the sort footing (the text Total) is in the fifth column of the report output. The second item in the sort footing (the field <ST.QUANTITY) is positioned in the next available column.


Top of page

x
Borders for Items Within Headings and Footings in PDF Report Output

How to:

In prior releases, StyleSheets only supported placing a border around an entire heading, footing, subheading, or subfooting. The new BORDERALL StyleSheet attribute supports a heading or footing grid with borders around each individual heading or footing cell in PDF report output. Using this attribute along with BORDER attributes for individual objects in a heading or footing enables you to create borders around individual items.

BORDERALL is the quickest way to add borders to the entire heading grid. Individual borders can be removed by explicitly turning the border off in individual items using BORDER, BORDER-LEFT, BORDER-RIGHT, BORDER-TOP, and BORDER-BOTTOM. For a given item that is bordered by BORDERALL, BORDER-LEFT=OFF presents the item with no left border, but the defined border style is retained for top, bottom, and right borders.

Three levels of borders for headings and footings are supported:

  1. Individual cell borders.

    BORDER-LEFT, BORDER-RIGHT, BORDER-TOP, and BORDER-BOTTOM can be used to set the individual components of the external border of the heading or a selected item or cell.

  2. All outer borders.

    BORDER= is used to set the external borders within a heading or footing.

  3. All outer and internal borders.

    BORDERALL is used to apply border characteristics to both the internal and external borders of the selected heading or footing.

Note: BORDERALL applies to the entire heading or footing element. It cannot be used for individual lines or items within a heading or footing element.



x
Syntax: How to Insert Inner and Outer Borders Within Headings or Footings

To turn on all external and internal borders (a border grid):

TYPE=headfoot, BORDERALL=option, [BORDER-STYLE=line_style,]    [BORDER-COLOR={color|RGB(r g b)},] $

where:

headfoot

Is the type of heading or footing. Valid values are TABHEADING, TABFOOTING, HEADING, FOOTING, SUBHEAD, and SUBFOOT.

Note: BORDERALL applies to the entire heading or footing element. It cannot be used for individual lines or items within a heading or footing element.

To request a uniform border, use this syntax:

TYPE=headfoot, BORDER=option

To specify different characteristics for the top, bottom, left, and/or right borders, use this syntax:

TYPE=headfoot, BORDER-position=option,
   [BORDER[-position]-STYLE=line_style,]
   [BORDER[-position]-COLOR={color|RGB(r g b)},] $

where:

headfoot

Identifies the heading, footing, subheading, or subfooting to which borders are applied.

option

Can be one of the following values:

ON turns borders on. ON generates the same line as MEDIUM.

Note: The MEDIUM line setting ensures consistency with lines created with GRID attributes.

OFF turns borders off. OFF is the default value.

LIGHT specifies a thin line.

MEDIUM identifies a medium line. ON sets the line to MEDIUM.

HEAVY identifies a thick line.

width specifies the line width in points, where 72 pts=1 inch. Note that this option is not supported with Excel 2003, which does not have an option for specifying a number to precisely set the border width (thickness) in points.

Tip: Line width specified in points is displayed differently in HTML and PDF output. For uniform appearance, regardless of display format, use LIGHT, MEDIUM, or HEAVY.

position

Specifies which border line to format. Valid values are: TOP, BOTTOM, LEFT, RIGHT.

You can specify a position qualifier for any of the BORDER attributes. This enables you to format line width, line style, and line color individually, for any side of the border.

line_style

Sets the style of the border line. FOCUS StyleSheets support all of the standard Cascading Style Sheet line styles. Several three-dimensional styles are available only in HTML, as noted by asterisks. Valid values are:

Style

Description

NONE

No border is drawn.

SOLID

Solid line.

DOTTED

Dotted line.

DASHED

Dashed line.

DOUBLE

Double line.

GROOVE*

3D groove. (Not supported with Excel 2003, which has no option for specifying this type of border.)

RIDGE*

3D ridge. (Not supported with Excel 2003, which has no option for specifying this type of border.)

INSET*

3D inset.

OUTSET*

3D outset.

color

Is one of the preset color values. The default value is BLACK.

If the display or output device does not support colors, it substitutes shades of gray.

RGB

Specifies the font color using a mixture of red, green, and blue.

(r g b)

Is the desired intensity of red, green, and blue, respectively. The values are on a scale of 0 to 255, where 0 is the least intense and 255 is the most intense. Using the three color components in equal intensities results in shades of gray.



Example: Controlling Borders Within Heading and Footing Elements in PDF Report Output

The following request against the EMPLOYEE data source has a page heading, a subheading, a subfooting, and a report footing:

TABLE FILE EMPLOYEE
HEADING
" Department Report Page <TABPAGENO "
PRINT LAST_NAME AS ''
FIRST_NAME AS ''
CURR_SAL AS ''
CURR_JOBCODE AS ''
BY DEPARTMENT AS ''
WHERE CURR_SAL NE 0.0
ON TABLE HOLD FORMAT PDF
ON DEPARTMENT SUBFOOT
" "
"Subtotal:<ST.CURR_SAL"
" "
ON DEPARTMENT SUBHEAD
"Department <+0>Last Name <+0>First Name <+0>Salary<+0>Jobcode <+0>"
ON TABLE SUBFOOT
"Grand Total:<ST.CURR_SAL"
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, FONT=ARIAL, BORDER=ON, SQUEEZE=ON, $
TYPE=REPORT, COLUMN=CURR_JOBCODE,SQUEEZE=.75, $
TYPE = SUBHEAD, HEADALIGN=BODY, BORDERALL=ON,$
TYPE = SUBFOOT, HEADALIGN=BODY,$
TYPE = SUBFOOT, LINE=2, ITEM=1, COLSPAN=3, JUSTIFY=RIGHT,$
TYPE = SUBFOOT, LINE=2, ITEM=2, JUSTIFY=RIGHT,$
TYPE = TABFOOTING, HEADALIGN=BODY,$
TYPE = TABFOOTING, ITEM=1, COLSPAN=3, JUSTIFY=RIGHT,$
TYPE = TABFOOTING, ITEM=2, JUSTIFY=RIGHT,$
END
 

The REPORT component has BORDER=ON, so the page heading has an external border.

The subheading has BORDERALL=ON and HEADALIGN=BODY, so the subheading grid aligns with the body grid, and each item within the subhead is presented as fully bordered individual cells.

The StyleSheet aligns the subfooting elements with the body of the report, and has the salary subtotal on the second line aligned and justified with the CURR_SAL column.

The table footing has a border around the entire footing because the REPORT component specifies BORDER=ON. The grand total is aligned and justified with the CURR_SAL column on the report.

The output is:


Top of page

x
Aligning Subheading and Subfooting Margins With the Report Body

How to:

Reference:

Currently, with SQUEEZE=ON, the right margin border for subheadings and subfootings is defined based on the maximum width of all heading, footing, subheading, and subfooting lines. The length of subheading and subfooting lines is tied to the lengths of the page heading and page footing, not to the size of the data columns in the body of the report.

You can use the ALIGN-BORDERS=BODY attribute in a StyleSheet to align the subheadings and subfootings with the report body on PDF report output instead of the other heading elements.



x
Syntax: How to Align Subheading and Subfooting Margins With the Report Body

You can align subheading and subfooting margins with the report body either by adding the ALIGN-BORDERS=BODY attribute to the StyleSheet declaration for the REPORT component, or placing it in its own declaration without a TYPE attribute.

[TYPE=REPORT,] ALIGN-BORDERS={OFF|BODY} ,$

where:

OFF

Does not align the right margin of subheadings and subfootings with the report body.

BODY

Specifies that the width of subheading and subfooting lines is independent of heading, footing, tabheading, and tabfooting lines, and that the right border of the report body will be aligned by either extending subheading and subfooting lines (if they are narrower than the data columns) or extending the data columns (if the data columns are narrower than the maximum width of subheadings and subfootings).



x
Reference: Considerations for Aligning Subheading and Subfooting Margins With the Report Body

Without the ALIGN-BORDERS=BODY attribute, the width of the subheading and subfooting lines is determined by the largest width of all of the headings and footings (report, page, subheadings, and subfootings).

The following image illustrates report output without the ALIGN-BORDERS=BODY attribute.

When the body lines are wider than the subheading and subfooting lines, the border and backcolor of the subheading and subfooting lines are expanded to match the width of the data lines, as shown on the following report output.

If the subheading and subfooting lines are longer than the body lines, an additional filler cell is added to each data line to allow the defined borders and backcolor to fill the width defined by the subheading and subfooting lines, as shown on the following report output.

ALIGN-BORDERS=BODY has been designed to work on:



Example: Aligning Subheading and Subfooting Margins in a Single Panel PDF Report

The following request against the GGSALES data source has a report heading, report footing, page heading, page footing, and a subheading for each region. The margins of the subheadings and subfootings are not aligned (ALIGN-BORDERS=OFF ,$):

DEFINE FILE GGSALES
SHOWCATPROD/A30 = CATEGORY || (' / ' | PRODUCT);
END
TABLE FILE GGSALES
SUM
DOLLARS/I8M AS ''
BY REGION
BY ST
BY CITY
ACROSS SHOWCATPROD AS 'Product Sales'
ON REGION SUBHEAD
" "
"Subheading <+0>Region <REGION<+0> "
" "
ON REGION SUBTOTAL AS '*TOTAL'
ON TABLE SUBHEAD
"Report Heading"
" "
"TYPE=REPORT, ALIGN-BORDERS=OFF, BORDER=ON, $"
HEADING
"Page Heading "
" "
" "
" "
FOOTING
" "
"Page Footing<+0>Page <TABPAGENO "
ON TABLE SUBFOOT
" "
"Report Footing"
WHERE CATEGORY EQ 'Coffee';
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
FONT='ARIAL',
SIZE=9,
LEFTMARGIN=.75,
RIGHTMARGIN=.5,
TOPMARGIN=.1,
BOTTOMMARGIN=.1,
ALIGN-BORDERS=OFF,
BORDER=ON,
SQUEEZE=ON,
$
TYPE=TITLE,
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=TABHEADING,
LINE=3,
JUSTIFY=CENTER,
$
TYPE=TABFOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
IMAGE=smplogo1.gif,
POSITION=(+4.6000000 +0.03000000),
JUSTIFY=RIGHT,
$
TYPE=FOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=FOOTING,
LINE=2,
ITEM=2,
OBJECT=TEXT,
POSITION=6.3,
SIZE=12,
STYLE=BOLD,
$
TYPE=SUBHEAD,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=2,
ITEM=3,
OBJECT=TEXT,
POSITION=2.5,
$
TYPE=SUBFOOT,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBTOTAL,
BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
SIZE=9,
WRAP=ON,
$
TYPE=ACROSSTITLE,
STYLE=BOLD,
$
TYPE=GRANDTOTAL,
BACKCOLOR=RGB(210 210 210),
STYLE=BOLD,
$
ENDSTYLE
END

The output shows that the subheading margins align with the heading, not with the report body.

Now change the ALIGN-BORDERS attribute to ALIGN-BORDERS=BODY and rerun the request. The subheadings now align with the report body, as shown in the following image.



Example: Aligning Suheading and Subfooting Margins in a Multi-Panel Report

The following request has HEADPANEL=ON for all headings and footings. It also has the ALIGN-BORDERS=BODY attribute:

SET BYPANEL=ON
DEFINE FILE GGSALES
SHOWCATPROD/A30 = CATEGORY || (' / ' | PRODUCT);
END
TABLE FILE GGSALES
SUM 
     DOLLARS/I8M AS ''
BY REGION
BY ST
BY CITY
ACROSS SHOWCATPROD AS 'Product Sales'
     
ON REGION SUBHEAD
" "
"Subheading <+0>Region <REGION<+0> "
" "
ON REGION SUBTOTAL AS '*TOTAL'
ON TABLE SUBHEAD
"Report Heading"
" "
"TYPE=REPORT, ALIGN-BORDERS=BODY, HEADPANEL=ON, BORDER=ON, $"
HEADING
"Page Heading "
" "
" "
" "
FOOTING
" "
"Page Footing<+0>Page <TABPAGENO "
ON TABLE SUBFOOT
" "
"Report Footing"
WHERE CATEGORY NE 'Coffee';
ON TABLE SET PAGE-NUM OFF 
ON TABLE HOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=9,
     LEFTMARGIN=.75,
     RIGHTMARGIN=.5,
     TOPMARGIN=.1,
     BOTTOMMARGIN=.1,
     HEADPANEL=ON,
     ALIGN-BORDERS=BODY,
     BORDER=ON,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     LINE=3,
     JUSTIFY=CENTER,
$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     IMAGE=smplogo1.gif,
     POSITION=(+4.6000000 +0.03000000),
     JUSTIFY=RIGHT,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=FOOTING,
   LINE=2,
   ITEM=2,
   OBJECT=TEXT,
   POSITION=6.3,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBHEAD,
   LINE=2,
   ITEM=3,
   OBJECT=TEXT,
   POSITION=2.5,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
     WRAP=ON,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END

The output shows that the subheadings are aligned with the data on each panel.


Information Builders