Sage-ST ä Tutorial
Lesson 12


  1. Overview. In this lesson you will create new report forms that will allow you to generate a report greater than 80 characters wide.

2. What You'll Use.
You will use the THOR forms editor.

3. Assignment.
It seems that the reports that customers want are seldom simple, 80-character affairs. They want reports landscaped, using a special font, and 160 characters per line.

This lesson will cover landscaping, special fonts, resetting margins, etc., only briefly. Reports.WrDirect can be used to send escape sequences to a report to control most aspects of the report appearance. These escape sequences are, of course, printer-dependent; therefore, you must know the target printer(s). The user's manual of each printer should provide the escape sequences needed.

Your current report lists a very limited amount of data on each employee. Now you want to list the employee name, SSN, the full address, the organization for which the employee works--120 characters worth of stuff. The only things that have to be changed are the header and body forms. The easiest way to do this is as follows:


1. Go into THOR and add a new form called "temp" (or some similarly description name).

2. Go into this form. At the top left-hand corner, press <Alt/1> (use the '1' on the key pad, not the '1' above the alphabet). When you release the Alt key, a smiley face should appear. Right next to the smiley face put a '2'. Sage-ST will interpret this to mean that every two lines on the form are to be considered one line in the report. If you had put a '4' after the smiley face, Sage-ST would take every four lines and string them end to end to create one long line. (The longest line currently supported by Sage-ST is 320 characters, or 4 lines of a form.) Do not put anything else on this first line.

3. Design your header and body on this screen--don't worry about windowing. This will take some doing; you'll notice that the two forms in "Our Solution" look rather confused. By designing the header and body (and footer, if one exists) on one screen, you are assured that your fields line up with your column headings.

4. Exit out of temp. Go into RptEmpH and copy temp over RptEmpH using <Alt/K>. Window the smiley face and the header.

5. Repeat step #4 for RptEmpB, but window the smiley face and the body. Delete everything else.

6. Recompile your SRC and run your program. Send your report to a file on your hard drive--sending it to the console won't tell you much. Then use your text editor to look at the file. Make any necessary adjustments using THOR and/or code to get the report to look the way you want it.


4. Our Solution.


FORM REPORT FOR HRS

RptEmpB Employee report body 8 Field(s)
packed picture size -> 87 bytes
predominant color -> white on black
------------------------------------------------------------------------------
░░░░░1░░░░░ ║ ░░░░░░░2░░░░░░░, ░░░░░░░3░░░░░░░ ║ ░░░░░░░░░4░░░░░░░░░░ ░░░░░░░5░
░░░░░░ 6░ ░░7░░ ║ ░░8░





------------------------------------------------------------------------------

Field Display Type Record & (Field) - rpt Field Type Help Form
------------------------------------------------------------------------------
1 Display Only Employee(SSN) - 1 Social Security Number
2 Display Only Employee(LastNam) - 1 Alphanumeric
3 Display Only Employee(FirstNam)- 1 Alphanumeric
4 Display Only Employee(StrtAddr)- 1 Alphanumeric
5 Display Only Employee(City) - 1 Alphanumeric
6 Display Only Employee(State) - 1 Upper Case Alphanumeric
7 Display Only Employee(Zip) - 1 Upper Case Alphanumeric
8 Display Only Employee(OrgNum) - 1 Alphanumeric

RptEmpH Employee report header 0 Field(s)
packed picture size -> 197 bytes
predominant color -> white on black
-----------------------------------------------------------------------------
J 2
EMPLOYEE REPORT

(sorted by employee SSN)



E m p l o y e e N a m e

SSN ║ Last First ║ Street Address City
State ZIP ║ Organization
════════════╬═══════════════════════════════════╬═══════════════════════════
═══════════════════╬═════════════════════

----------------



Go Back To Tutorial Table of Contents


warren.merrill@inl.gov , ftp://sage.inel.gov
Copyright © 1989-2006. Battelle Energy Alliance