Need help? Email or Call Us: (952) 933-0609

How to format SEQUEL Host Reports

SEQUEL includes a report writer called the SEQUEL Host Report Writer. This writer produces reports using monospaced fonts typical of the System i (AS/400). The great advantage of such reports is that they make it easy to line up items such as columns of figures.

While the SEQUEL Host Report Writer offers fewer formatting options than the Client Report Option, report formatting is still a major concern for SEQUEL users using the Host Report Writer. This article focuses on report formatting for the Host Report Writer.

Let’s look at a sample report called GHBEXER6R from the SEQUELEX library that’s distributed with SEQUEL. Figure 1 shows how the report looks displayed in the ViewPoint Report Design window.

Figure1: Sample report in the ViewPoint Design window.

This report is based on the ORDERSUM view in the same library. The view contains the following statement:

SELECT cusno.2, cname.1, cadd1.1, cadd2.1, cadd3.1, cstte.1, czipc.1, 
cphon.1,coomn*10000+coody*100+cooyr LEN(6,0)EDTCDE(Y)

COLHDG("Order" "Date") NAME(ordate), ordno.2, cuspo.2, shipv.2, trmcd.2, 
trmds.2, ostat.2, otype.2, curln.2, orval.2, ortot.2, orwgt.2, coomn.2, 
coody.2, cooyr.2

FROM sequelex/custmast, sequelex/ordhead

JOIN BY cusno.1=cusno.2

ORDER BY cusno, cooyr, coomn, coody

Key report-formatting concepts
As you work on report formatting, there are some key concepts to keep in mind. The most basic is the break level. A break level refers to a change in the pattern of data, such as when a new record contains a change in a division, region, or customer field.

Most reports have at least three standard format levels: heading, detail, and total. Each format level can include multiple lines of data and you can choose not to use a level. In general:

  • The heading level is used to print the same information (such as date, title, and page number) at the top of every page.
  • The detail level is for the body of the report.
  • The total level prints only once at the very end of the report.

Suppressing detail information
Detail information can be “suppressed” so it prints only at certain instances, such as once per customer or at the top of a new page. This can make a cleaner, clearer layout for your report.

To suppress selected fields, display the report in the ViewPoint Report Design window. Type an S next to the active format line, to show the “skeleton display.” Then, right-click a field and select “Properties” to change the break level suppression. A pull-down menu in the Report Field Properties dialog (Figure 2), lets you select the break levels.

Figure 2: Report Field Properties dialog.

The sample report (Figure 1) uses multiple detail lines. Lines 2 through 7 (immediately below the @DETAIL bar in the ViewPoint Report Design window) contain the customer name and address information and subheadings. These fields are set to print at CUSNO (when the CUSNO field changes from one customer number to the next) and at overflow (a page break).

Inserting additional formats
To insert additional formats between the detail and total levels, modify the underlying view’s ORDER BY clause. For example, including a subtotal field in the ORDER BY allows the report to create a subtotal line.

In the sample report, format levels are available for the date fields COODY, COOMN and COOYR, however, these levels are not used. The CUSNO format level, which was used, prints the customer’s detailed information only once.

We hope this article takes some of the mystery out of working with report break levels. Start building your SEQUEL reports today!

Contributed by Steven Smith, Technical Writer  

Need Help?

Talk to Us
In the U.S. and Canada, call 1-800-328-1000 and ask for Sales.
Elsewhere in the world, contact your local international office.