This chapter provides an overview of the SETUP section and discusses how to:
Create a SETUP section.
Use the DECLARE-LAYOUT command.
Override default settings.
Declare a page orientation.
You place all declarations in a SETUP section. Declarations define certain report characteristics and the source and attributes of various report components, such as charts and images. The SETUP section is evaluated when you compile the program, before you run the program. A program is not required to have a SETUP section, but it can be useful.
Place a SETUP section at the beginning of the program, before the PROGRAM section. Begin the section with a BEGIN-SETUP paragraph and end it with an END-SETUP paragraph.
Use the following commands in the SETUP section:
Command |
Comment |
ALTER-LOCALE |
Can also appear in a procedure. |
ASK |
Allowed only in a SETUP section. |
BEGIN-SQL |
Can also appear in a procedure. Processed when a runtime file (with .SQT extension) is loaded. |
CREATE-ARRAY |
Can also appear in a procedure. |
DECLARE-CHART |
NA |
DECLARE-IMAGE |
NA |
DECLARE-LAYOUT |
NA |
DECLARE-PRINTER |
NA |
DECLARE-PROCEDURE |
NA |
DECLARE-REPORT |
NA |
DECLARE-TOC |
NA |
DECLARE-VARIABLE |
Can also appear in a local procedure. |
LOAD-LOOKUP |
Can also appear in a procedure. |
USE |
Sybase only. |
See Also
Enterprise PeopleTools 8.50 PeopleBook: SQR Language Reference for PeopleSoft
Use the DECLARE-LAYOUT command to set the page layout and to include important options, such as the paper size and margins.
This section provides a sample SETUP program and discusses how to define the SQR page layout.
Here is a typical SETUP section:
begin-setup ! Declare the default layout for this report declare-layout default paper-size=(8.5,11) left-margin=1 right-margin=1 top-margin=1 bottom-margin=1 end-declare end-setup
In the preceding example, the DECLARE-LAYOUT command sets the paper size to 8 1/2 by 11 inches, with all margins at 1 inch.
In SQR for PeopleSoft, data is positioned on the page using line and character position coordinates. Think of the page as a grid and each cell in the grid holds one character. With such a grid, in a position qualifier consisting of (line, column, width), column and width are numbers that denote characters and spaces.
The main attributes of the DECLARE-LAYOUT command affect the structure of a page.
The PAPER-SIZE argument defines the dimensions of the entire page, including the margins. The TOP-MARGIN, LEFT-MARGIN, BOTTOM-MARGIN, and RIGHT-MARGIN arguments define the margins. In SQR, you cannot print in the margins.
In the preceding sample program, the left margin uses 10 spaces and the top margin uses 6 lines. The page width accommodates 65 characters (without the margins) and 54 lines.
The default mapping of characters and lines to inches is 10 characters per inch and six lines per inch . These dimensions mean that each character cell is 1/10 inch wide and 1/6 inch high. These settings are used when a program does not contain a DECLARE-LAYOUT command.
Override the default settings by using the LINE-HEIGHT and CHAR-WIDTH arguments in the DECLARE-LAYOUT command. These arguments adjust the dimensions of a grid, implying a change in the meaning of column and line. If the DECLARE-LAYOUT paragraph includes the LINE-HEIGHT=1 and CHAR-WIDTH=1 arguments, then the cells in the grid measure one point by one point (one point is 1/72 inch or approximately 0.35 millimeters). In that case, column is a dimension described in points. The length of a string, however, is still described in characters.
Alternatively, you can use the MAX-LINES and MAX-COLUMNS arguments of the DECLARE-LAYOUT command to specify the number of lines on a page and the number of characters that will fit across the page. SQR calculates the line height and character width based on these settings and the size of the page and margins.
Specify coordinates in terms of lines and character positions. The first line from the top is 1 and the first column (from the left) is 1. No coordinate 0 exists.
Use the DECLARE-LAYOUT command to declare a page orientation. Note that this declaration does not affect how SQR uses position coordinates. Line and character positions are not transposed when page orientation is switched. The only effect of the ORIENTATION option of the DECLARE-LAYOUT command is that SQR switches the printer to the specified orientation: portrait or landscape. The default mode is portrait.