Progress
Results User’s Guide
for UNIX


Adding Break Groups, Totals, and Page Ejects

This section explains how to define totals and subtotals to show the total cost for each customer and the total for all customers. The total line for each customer creates a break group. A break group divides a report into sections.

To add break groups to your report, you define order criteria for the lines in the report and add totals and subtotals. For example, in this section you show the total cost of items ordered by each customer. You also add page ejects which force the information for each customer you start on its own page.

To create a break group in a report, you define the order criteria first, then define subtotals for the group. So far, the lines in Order Line Report have been in their default order (by customer number, even though customer number is not a field in the report). Now you put them in alphabetical order by customer name.

Changing Order of Records

Follow these steps to change the order of your records.

  1. Select Order in the Reports module.
  2. A window opens that displays all the fields you can use to order the report. You can choose as many as five fields to order your report. All fields from the active files are available, except array fields (you cannot order records by array fields).

  3. Select the Name field from the customer file. The number 1 appears next to the field.
  4. Press GO.
  5. Now you can put the records in ascending (increasing) or descending (decreasing) order by the field you chose:

  6. Press RETURN or GO to accept the default (ascending order).
  7. The order definition appears in the Report Info window:

    The order definition indicates that the report is ordered by the Name field in the customer file within the mysports database. Now when you run the report, the records are in alphabetical order by customer name.

Adding Total Lines

In this section, you add a Total Line to show the total cost for all the orders for each customer. This Total Line creates a break group, which breaks the report into sections by customer.

Follow these steps to add a Total Line to your report:

  1. Select Define in the Reports module.
  2. Select Totals and Subtotals.
  3. A list of the fields in the report appears:

    You can define totals for any of these fields.

  4. You can use the MODE key to view the listing of the fields on the report by label or by name. If you are listing fields by label, select the Price/Line field. If you are listing fields by name, select the qbf-007 field.
  5. The following window appears:

    The Summary Line option lets you define a summary line for the Price/Line field. You can show the total, count, minimum, maximum, and average values for the Price/Line field. For example, if you want a summary line at the end of the report to show the total cost of orders for all customers, change the first no under Total to yes.

    Because you defined sort order on a field, you can also define totals on it. For example, you can show the total cost for orders for each customer.

  6. Change the first no under Total to yes. (This no corresponds with the Summary Line.)
  7. This adds a total for all the reports on the summary line at the bottom of the report.

  8. Change the second no under Total to yes.
  9. NOTE: If you want to delete a total line from the report definition, access this window again and change the yes to no.

  10. Press GO to make the changes to the report.
  11. The list of fields in the report appears again so you can define a total on another field.

  12. Press END to exit the list without defining another total.
  13. Two total markers (t1 and t6) appear in the Report Layout window to indicate that there are totals defined for the Price/Line field.

    The t1 marker represents a total on the first order-by; the t6 marker represents a grand total at the bottom of the report.

  14. Run this report on your terminal.
  15. The first page of the report appears:

Defining a Page Eject

You can define page ejects on any field you use to order your report. In this case, you ordered the report only by the Customer Name field. Therefore, you can define a page eject so that Results starts a new page each time the customer name changes.

  1. Select the Settings option, then select the Page Ejects option.
  2. The Page Ejects window appears.

  3. Select mysports.Customer.Name to create a page eject each time the customer name changes.
  4. Run the report on your terminal.
  5. Results displays the first page of your report:

    This screen shows you the total cost for each order line for each customer.

    By adding the total line for each customer, you created a break group. This new layout makes it easier to determine the total cost for each customer. Because you added the page break, each customer appears on its own page.

  6. Return to the Reports module window and use Put to save this report and overwrite the current Order Line Report.
  7. To do this, select Order Line Report, then press RETURN instead of entering a new description. When Results prompts you to overwrite the report, select Yes.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095