Wrapping and Justifying Report Components

In this section:

You can position data within a report by specifying whether or not you wish to have data wrap within a cell or by selecting a justification (right, left or center) of a column or heading.


Top of page

x
Controlling Wrapping of Report Data

How to:

Reference:

You can control the wrapping of report data in a report, thus preventing line breaks within report cells. When using HTML output, most Web browsers will, by default, wrap alphanumeric report data that does not fit on a single line in a cell.

This bumps the contents of the cell onto a second line. A Web browser wraps data based on its algorithmic settings. Use the WRAP attribute if you wish to suppress a Web browser from wrapping data.

By default, WRAP is set to ON for HTML output, allowing each individual browser to define the width of each column in the report. For PDF, PS, DHTML, PPT, and PPTX output, WRAP is set OFF by default. For these positioned output formats in which the location of each item in the report is explicitly defined, WRAP = ON is not a valid value, except when specified for ACROSSVALUE. For other elements of the report, such as headers, footers, titles, or data, define the width of wrapped lines by using a numeric value, as in WRAP = n.

In PDF and PostScript report output, you can control the line spacing in wrapped lines by using the WRAPGAP attribute.

Wrapping Data in PDF Reports That Use the OVER Phrase

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. In many cases, reports that place columns over each other use blank AS names in order to align the columns properly. You can use the WRAP attribute to wrap data in PDF reports that use OVER and this technique works well with blank AS names.

Wrapping Data in PDF Reports That Use the ACROSS Phrase

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.

For information about wrapping in Excel 2000 reports, see Controlling Column Width and Wrapping in EXL2K Report Output.



x
Syntax: How to Control Wrapping of Report Data Using a StyleSheet Attribute

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

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

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. See Identifying Report Components for more information about how to specify different report components.

value

Is one of the following:

  • ON, which turns on data wrapping. ON is the default value for HTML report output. For PDF, PS, DHTML, PPT, and PPTX report output, WRAP is set OFF by default. For these positioned output formats in which the location of each item in the report is explicitly defined, WRAP = ON is not a valid value, except when specified for ACROSSVALUE. For other elements of the report, such as headers, footers, titles, or data, define the width of wrapped lines by using a numerical value, as in WRAP = n. For HTML reports, WRAP is supported with all fields. For PDF reports, WRAP is supported only with embedded fields, not text.

    Note: This setting is not supported when using WRAP with OVER in PDF report output.

  • OFF, which turns off data wrapping. This is the default value for PDF, PS, DHTML, PPT, and PPTX report output.
  • n, which represents a specific numeric value that the column width can be set to. The value represents the measure specified with the UNITS parameter. This setting is supported for wrapping data in PDF reports that use the OVER phrase.

Note:



Example: Allowing the Web Browser to Wrap Report Data

The following example, with WRAP=ON, wraps report data based on the Web browser's functionality. Note that because this value is the default, there is no need to specify WRAP=ON in the report request syntax.

Note: The size of the browser window will impact if the data in the cells are wrapped.

TABLE FILE GGPRODS
PRINT SIZE UNIT_PRICE PACKAGE_TYPE
VENDOR_CODE VENDOR_NAME
BY PRODUCT_ID BY PRODUCT_DESCRIPTION
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is:

Notice that records in the Vendor Name column break to a second line.



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 PCHOLD 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 PCHOLD 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
Syntax: How to Control Spacing Between Wrapped Lines

You can use the WRAPGAP attribute in a StyleSheet to control spacing between wrapped lines in PDF and PostScript report output.

type=component, WRAPGAP={ON|OFF|n}

where:

component

Is the component with wrapped lines.

ON

Does not leave any space between wrapped lines. ON is equivalent to specifying 0.0 for n.

OFF

Places wrapped data on the next line. OFF is the default value.

n

Is a number greater than or equal to zero that specifies how much space to leave between wrapped lines (using the unit of measurement specified by the UNITS attribute). Setting n to zero does not leave any space between wrapped lines, and is equivalent to specifying WRAPGAP=ON.



Example: Specifying Spacing for Wrapped Lines

In the following request, wrapping is turned on for the ADDRESS_LN3 column of the report:

TABLE FILE EMPLOYEE                         
PRINT ADDRESS_LN3                           
BY LAST_NAME BY FIRST_NAME                  
WHERE LAST_NAME LE 'CROSS'                  
  ON TABLE HOLD FORMAT PDF    
ON TABLE SET PAGE NOPAGE                    
ON TABLE SET STYLE *                        
type=report, grid=on, $                      
type=data, topgap=0.2, bottomgap=0.2,  $    
type=data, wrapgap=off, $                    
type=REPORT, column=ADDRESS_LN3, wrap=1.0 ,$
END                                         

With WRAPGAP=OFF, each wrapped line is placed on the next report line:

With WRAPGAP=ON, the wrapped lines are placed directly under each other:



x
Syntax: How to Wrap ACROSS Values

Wrapping ACROSS Values is supported for HTML and PDF output formats.

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.

Note: WRAP=ON is not supported with JUSTIFY.



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 PCHOLD 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 PCHOLD 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.



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 PCHOLD 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 PCHOLD 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.



x
Reference: Usage Notes for WRAPGAP

Top of page

x
Controlling Wrapping With Alternative Methods

How to:

Reference:

In addition to the WRAP parameter, whether or not text wraps within a cell is affected by the SQUEEZE and GRID attributes. Both SQUEEZE and GRID can be used as SET commands or StyleSheet attributes. By specifying a setting other than the default value for these two attributes, the wrapping behavior in a browser is affected.



x
Reference: Set Commands that Affect Wrapping in a Report

The following SET commands affect the wrapping of data.

Command

Action

SET SQUEEZE=OFF

Forces the browser to display the entire column width and suppresses the wrapping of column data.

SET SQUEEZE=ON

Allows the browser to follow its own display behavior. If a browser's settings so specify, columns will be compressed to the length of the longest data value, and column data with embedded blanks will be wrapped.

SET GRID=OFF

Automatically suppresses the wrapping of data.

SET GRID=ON

Has no effect on either wrapping or compressing column width.



x
Syntax: How to Control Wrapping Using SQUEEZE

SQUEEZE can be used as either a SET parameter or a StyleSheet attribute. To control wrapping using SQUEEZE, use the following syntax within a StyleSheet.

TYPE =type, SQUEEZE=value, $

where:

type

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

value

Is one of the following:

ON turns on data wrapping. This is the default for HTML output.

OFF turns off data wrapping. This is the default for PDF and PostScript.

n represents a specific numeric value to which the column width can be set (valid only in PDS and PostScript) The value represents the measure specified with the UNITS parameter.



x
Syntax: How to Control Wrapping Using SQUEEZE as a SET Command

To suppress the wrapping feature in a report by setting the SQUEEZE parameter to OFF, use the following syntax

SET SQUEEZE=value, $

where:

value

Is one of the following:

ON turns on data wrapping.

OFF turns off data wrapping. This is the default.

n represents a specific numeric value to which the column width can be set (valid only in PDS and PS). The value represents the measure specified with the UNITS parameter.

Note: SQUEEZE turns off data wrapping. If a data value is wider than the specified width of the column, it will be hidden from view. Column width can be adjusted in Excel after the spreadsheet has been generated.



x
Reference: Usage Notes for WRAP and SQUEEZE

Most Web browsers-by default-determine the width of a report column using an internal algorithm. If a data value exceeds the column's width, the browser wraps that data onto the next line of the column. If you want to prevent these line breaks, you can override this browser behavior by using the WRAP StyleSheet attribute.

Specifying a width is supported in HTML reports that generate an internal cascading style sheet, as well as in PDF and PostScript reports.

If you do not specify the WRAP attribute in:

Note that the WRAP and SQUEEZE attributes are incompatible: you should not apply both of them to the same report component.

The WRAP attribute is for alphanumeric columns, and is not supported for text (TX) columns.



x
Reference: Working With Multi-Table HTML Reports


Example: Displaying a Multiple-Table HTML Report

In this request, each page is returned to the browser as a separate HTML table. SQUEEZE is set to OFF for consistent alignment of tables across pages.

SET STYLEMODE = PAGED 
SET LINES = 12
TABLE FILE CENTORD
HEADING
"SALES OVER $200,000"
PRINT LINEPRICE AS 'Sales'
BY SNAME BY ORDER_NUM
WHERE LINEPRICE GT 200000
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, SQUEEZE=OFF, $
ENDSTYLE
END

Two pages of the report follow, showing consistent alignment:

The same two pages illustrate inconsistent alignment with SQUEEZE set to ON:


Top of page

x
Justifying Report Columns

How to:

You can adjust text within a column by specifying whether report columns are left justified, right justified, or centered. By default, alphanumeric columns are left justified, numeric columns are right justified, and heading and footing elements are left justified. However, you can change the default using the JUSTIFY attribute. You can also justify column titles using the /R /L and /C formatting options in the report request.



x
Syntax: How to Justify a Report Column

To left justify, right justify, or center a column, use the following syntax within a StyleSheet.

TYPE=type, [subtype,] [COLUMN=column,] JUSTIFY=option, $

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.

column

Is the column or group of columns you wish to justify. This attribute is only necessary if you wish to justify a specific column or set of columns. Omitting this attribute justifies the entire report.

option

Is the justification you wish to select:

LEFT specifies that the column will be left justified.

RIGHT specifies that the column will be right justified.

CENTER specifies that the column will be centered.



Example: Justifying Data in a Report Column

The following example displays the StyleSheet syntax used to center the data in the Vendor Name column. The header is also center justified.

TABLE FILE GGPRODS
HEADING
"PRODUCT REPORT"
SUM UNITS BY PRODUCT_DESCRIPTION BY PRODUCT_ID BY VENDOR_NAME
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLE * 
TYPE=REPORT, COLUMN=VENDOR_NAME, JUSTIFY=CENTER,  $
TYPE=HEADING, JUSTIFY=CENTER, $ 
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output is:


Top of page

x
Justifying a Heading or Footing

How to:

Reference:

You can left justify, right justify, or center a heading or footing in a StyleSheet. By default, a heading or footing is left justified. In addition, you can justify an individual line or lines in a multiple-line heading or footing.

To center a page heading or footing over the report data, you can use a legacy formatting technique that does not require a StyleSheet; simply include the CENTER option in a HEADING or FOOTING command.

Justification behavior in HTML and PDF. For HTML reports, justification is implemented with respect to the report's width. That means a centered heading is centered over the report content. In contrast, for PDF reports, the default justification area is the page width, rather than the report width. This results in headings and footings that are not centered on the report. In most cases, you can achieve justification based on report width in a PDF report by adding the command SET SQUEEZE=ON to your request. This command improves the appearance of the report by eliminating excessive white space between columns and implements justification over the report content. However, if the heading is wider than the report, it will be centered on the page, even when SQUEEZE=ON.

Tip: You can also use justification syntax in combination with other StyleSheet syntax to align headings, footings, and items in them with other report elements, based on either unit measurements or relationships to other columns. For a summary of these options, see Aligning Heading and Footing Elements.



x
Syntax: How to Justify a Heading or Footing in a StyleSheet
TYPE = headfoot, [LINE = line_#,] JUSTIFY = option, $

where:

headfoot

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

line_#

Optionally identifies a line by its position in the heading or footing so that you can individually align it. If a heading or footing has multiple lines and you omit this option, the value supplied for JUSTIFY applies to all lines.

option

Is the type of justification. Valid values are:

LEFT which left justifies the heading or footing. This value is the default.

RIGHT which right justifies the heading or footing.

CENTER which centers the heading or footing.



Example: Centering All Lines in a Multiple-Line Report Heading

This request centers all lines in a multiple-line report heading using the single StyleSheet attribute for the entire heading:

TABLE FILE GGSALES
SUM BUDUNITS UNITS BUDDOLLARS DOLLARS
BY CATEGORY
ON TABLE SUBHEAD
"SALES REPORT"
"**(CONFIDENTIAL)**"
"December 2001"
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID=OFF, $ 
TYPE = TABHEADING, JUSTIFY = CENTER, $ 
ENDSTYLE
END

The output is:

Tip: To run this report in PDF format, add the code ON TABLE SET SQUEEZE ON to eliminate excessive white space between columns and to center the heading over the report.



x
Reference: Justification Regions and Behavior

The region in which text is justified depends on the relationship of the sizes of certain elements in the report:


Top of page

x
Justifying a Column Title

How to:

You can left justify, right justify, or center a column title for a display field, BY field, ACROSS field, or calculated value using a StyleSheet.

If a title is specified with an AS phrase in a request, or with the TITLE attribute in a Master File, that title will be justified, as specified for the field in StyleSheet syntax, if such syntax exists in the request.

Justification behavior in HTML and PDF. For HTML reports, justification is implemented with respect to the report's width. That means a centered column title is centered over a report column. In contrast, for PDF reports the default justification area is the page width, rather than the report width. This results in column titles that are not centered over the report column. You can achieve justification based on report width in a PDF report by adding the command SET SQUEEZE=ON to your request. This command improves the appearance of the report by eliminating excessive white space between columns and implements justification over the report content.



x
Syntax: How to Justify a Column Title Using a StyleSheet

To justify a column title for a vertical sort column (generated by BY) or a display column (generated by PRINT, LIST, SUM, or COUNT), the StyleSheet syntax is

TYPE=TITLE, [COLUMN=column,] JUSTIFY=option, $

To justify a horizontal sort column title (generated by ACROSS), the StyleSheet syntax is

TYPE=ACROSSTITLE, [ACROSS=column,] JUSTIFY=option, $

To justify an ACROSS value or a ROW-TOTAL column title in an HTML report, use

TYPE=ACROSSVALUE, [COLUMN=column,] JUSTIFY=option, $

where:

TITLE

Specifies a vertical sort (BY) title or a display field title.

column

Specifies the column whose title you wish to justify. If you omit this attribute and value, the formatting will be applied to all of the report's column titles.

ACROSSTITLE

Specifies a horizontal sort (ACROSS) title.

ACROSSVALUE

Specifies a horizontal sort (ACROSS) value or a ROW-TOTAL column title.

option

Is the type of justification. Valid values are:

LEFT which left justifies the column title. This value is the default for an alphanumeric field.

RIGHT which right justifies the column title. This value is the default for a numeric or date field.

CENTER which centers the column title. You cannot center an ACROSSTITLE in a PDF report.



Example: Using a StyleSheet to Justify Column Titles for Display and BY Fields

This request identifies each column by its field name and justifies each title separately.

TABLE FILE GGSTORES
PRINT STORE_NAME STATE AS 'St' BY ADDRESS1
WHERE STATE EQ 'CA'
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT HTML
ON TABLE SET SQUEEZE ON
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLESHEET *
TYPE = REPORT, GRID=OFF, $ 
TYPE=TITLE, COLUMN=STORE_NAME, JUSTIFY=CENTER, $
TYPE=TITLE, COLUMN=STATE, JUSTIFY=RIGHT, $
TYPE=TITLE, COLUMN=ADDRESS1, JUSTIFY=CENTER, $ 
ENDSTYLE
END

The output is:



Example: Using a StyleSheet to Justify a Column Title for ACROSS and ROW-TOTAL Fields

This request centers the column title, State, created by the ACROSS phrase over the two values (MT and WY) and the row total column title, Total by Gender, over the two row totals (Male Population and Female Population). Notice that each across value functions as a title for one or more columns in the report.

SET SQUEEZE = ON
TABLE FILE GGDEMOG
SUM MALEPOP98 FEMPOP98
ROW-TOTAL/D12 AS 'Total by Gender'
ACROSS ST
WHERE ST EQ 'WY' OR 'MT';
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF, $ 
TYPE=ACROSSTITLE, JUSTIFY=CENTER, FONT='TIMES', SIZE=11, STYLE=BOLD, $
TYPE=ACROSSVALUE, COLUMN=N5, JUSTIFY=CENTER, $ 
ENDSTYLE
END

The output is:



Example: Using a StyleSheet to Justify a Column Title for a Calculated Value

This request identifies the column title of the calculated value and left justifies it over the data.

TABLE FILE SALES
SUM UNIT_SOLD RETAIL_PRICE 
COMPUTE REV/D12.2M = UNIT_SOLD * RETAIL_PRICE; 
BY PROD_CODE
WHERE CITY EQ 'NEW YORK'
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF, $ 
TYPE=TITLE, COLUMN=REV, STYLE=BOLD, JUSTIFY=LEFT, $ 
ENDSTYLE
END

The output is:

Note: To run this report in PDF format, add the code ON TABLE SET SQUEEZE ON to eliminate excessive white space between columns and to justify column titles properly over the data.


Top of page

x
Justifying a Label for a Subtotal or Grand Total

You cannot directly justify a customized label for a subtotal. However, in HTML or EXL2K report output, if columns are being totaled or subtotaled by the one subtotal command, and you do not specify a column in the StyleSheet, formatting is applied to the totals and subtotals of all columns and to the labeling text that introduces the total and subtotal values.



Example: Justifying Subtotal and Grand Total Labels

This request subtotals the numeric columns in the report and right-justifies the output, including the text of the label that precedes the values for the subtotals. In this example, since numeric output is right justified by default, the justification specifications in the StyleSheet are used to reposition the labels. The default label for the automatically generated grand total is also right-justified.

TABLE FILE EMPLOYEE
SUM DED_AMT BY DED_CODE BY DEPARTMENT
BY BANK_ACCT
WHERE DED_CODE EQ 'CITY'
WHERE BANK_ACCT NE 0 
ON DEPARTMENT SUBTOTAL AS 'Total City Deduction for' 
ON TABLE SET PAGE-NUM OFF
ON TABLE HOLD FORMAT HTML
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF, $ 
TYPE=SUBTOTAL, STYLE=BOLD, JUSTIFY=RIGHT,$
TYPE=GRANDTOTAL, STYLE=BOLD, JUSTIFY=RIGHT,$ 
ENDSTYLE
END

The output is:


Information Builders