Designing a Free-Form Report

Topics:

To design the body of a free-form report, use the HEADING and FOOTING commands. They enable you to:

Use the HEADING command to define the body of a free-form report, and the FOOTING command to define what appears at the bottom of each page of a report. A footing is optional. You can define an entire report using just a heading.

Incorporating Text in a Free-Form Report

You can specify text anywhere in a free-form report, for a variety of purposes. In the sample request (see the example named Request for EMPLOYEE EDUCATION HOURS REPORT) text is used:

  • As a report title:
    "<13>EMPLOYEE EDUCATION HOURS REPORT"
  • As a label for data fields:
    "EMPLOYEE NAME:   <FIRST_NAME <LAST_NAME>"
  • With a data field and graphic characters:
    "<10>| EDUCATION CREDITS EARNED <CR_EARNED>|"
  • As a page footing:
    "<15>PRIVATE AND CONFIDENTIAL"

Incorporating Data Fields in a Free-Form Report

The crucial element in any report, free-form or otherwise, is the data. The data fields available in a request include data fields in the Master File, cross-referenced fields, and virtual fields created with the DEFINE command.

The sample request (see Request for EMPLOYEE EDUCATION HOURS REPORT) references all three types of data fields:

  • ED_HRS is found in the EMPLOYEE Master File:
    "TOTAL NUMBER OF EDUCATION HOURS: <ED_HRS>"
  • DATE_ATTEND is found in the EDUCFILE Master File, which is cross-referenced in the EMPLOYEE Master File:
    "MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>"
  • CR_EARNED is created with the DEFINE command before the TABLE FILE command, and is referenced as follows:
    "<10>| EDUCATION CREDITS EARNED <CR_EARNED>|"

You can also apply a prefix operator to a data field to select a particular value (for example, the maximum value within a sort group) or to perform a calculation (for example, to compute the average value of a field). You can use any available prefix operator in a free-form report.

In the sample request, the MAX prefix operator selects the most recent completion date of an in-house course:

"MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>"

As is true with all types of reports, you must understand the structure of the data source to use the prefix operators correctly.

Incorporating Graphic Characters in a Free-Form Report

Graphics in a report can be as creative as your imagination. The sample report (see Creating a Free-Form Report) uses special characters to enclose text and a virtual field in a box. Some other ideas include:

  • Highlighting key data fields using asterisks or other special characters available directly from your keyboard, or using the HEXBYT function. See the Using Functions manual for details on HEXBYT.
  • Enclosing the entire report in a box to give it a form-like appearance.
  • Using double lines to separate the body of the report from its page heading and page footing.

The use of special characters to create graphics is limited by what can be entered and viewed from your workstation and what can be printed on your printer. If you have difficulty producing the graphics that you want, be sure to check with someone in your organization who knows what is available.

Laying Out a Free-Form Report

To provide spacing in a report and position text and data fields, use the spot marker feature of the HEADING and FOOTING commands.

Note: To take advantage of this feature in an HTML report, include the SET STYLEMODE=FIXED command in your request.

The sample request (see the example named Request for EMPLOYEE EDUCATION HOURS REPORT) illustrates this feature. The first two examples show how to position text and data fields on your report, while the third example shows how to skip lines:

  • The spot marker <13> positions the specified text in column 13 of the report:
    "<13>EMPLOYEE EDUCATION HOURS REPORT"
  • The spot marker <23> positions the specified data field in column 23 of the report:
    "<23><ADDRESS_LN2>"
  • The spot marker </1 on a line by itself skips two lines after displaying the job description:
    "JOB DESCRIPTION: <JOB_DESC>""</1""MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>"

When designing a free-form report, take advantage of sort field options, such as NOPRINT, PAGE-BREAK (PDF output only), and UNDER-LINE. The sample request uses PAGE-BREAK to place each employee information on a separate page:

BY EMP_ID NOPRINT PAGE-BREAK

Sorting and Selecting Records in a Free-Form Report

As with tabular and matrix reports, you can both sort a report and conditionally select records for it. Use the same commands as for tabular and matrix reports. For example, use the BY phrase to sort a report and define WHERE criteria to select records from the data source.

WebFOCUS

Feedback