Sorts and Breaks [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Reference Manual
Sorts and Breaks
Data of a report is arranged by using up to nine nested sort items, each
in ascending or descending sequence.
Breaks occur each time a sort item value changes. For instance, if you
sort on CUSTOMER-NAME, all the occurrences of a particular customer name
are grouped together. When the next group of customer names is ready to
print, that is a break.
When you define the report layout, you can create a break heading or
footing so you can have text appear before or after the break occurs.
See Chapter 7 for details on break headings.
To sort and break the report
1. From the Define Report screen, choose Define Breaks. The Define
Breaks and Pagination screen appears.
2. Type the item names to sort in the Sort and Break on Item column.
3. Tab to the Sort Level and Order field and type a number (1 through
9) for the sort level.
4. Type a letter (next to the sort level number) for Ascending (A) or
Descending (D). Ascending sorts the records from A to Z or from 0
to 9 (and up). Descending sorts the records in the reverse order.
Example: Specifying a sort sequence
In this example, a sort sequence has been specified for the items
CUSTOMER-NAME, ORDER-NO., and SALES-AMOUNT.
For each customer name, order numbers are sorted, and for each order
number, sales amounts are sorted. Also, for CUSTOMER-NAME and ORDER-NO,
ascending sort order is specified, and for SALES-AMOUNT, descending sort
order is specified.
Customizing Breaks
Every time the value of a sorted item changes, you can customize your
report at the break that occurs. For instance, you can:
* Have additional text, items, or summarized data printed either
before a break or after a break. See Chapter 7 for details on
how do do this.
* Specify a break to occur when only part of the value changes. You
can indicate to what degree the value can change before a break
occurs. That is, you can create a break if only a certain part of
the item value changes. For instance, suppose you want a break in
your report every time the month changes in a date item. You
specify a "Change Degree" for that sort and break. See the
following procedure.
To indicate a change degree for a break
1. At the Define Breaks and Pagination screen, type the instructions
for the change degree in the Change Degree for Break field. Use
the table below as a guide.
------------------------------------------------------------------------------------------
| |
| For... Type in the Change Degree for Break field: |
| |
------------------------------------------------------------------------------------------
| |
| String items A number for the last character position where you want the |
| break to begin if there is a change. For instance, if the item |
| has 26 characters, and you want to break if there is a change in |
| the first 10 characters, you type 10 in the Change Degree for |
| Break field. |
| |
| Count the character position beginning from the left. |
| |
| Numeric items A number that is the least significant digit for the break as |
| the 10th exponent of this digit. |
| |
| Valid number ranges are as follows: |
| |
| |
| N(umeric): -6 to 12 |
| |
| I(nteger): 0 to 8 |
| |
| R(eal): -90 to 76 |
| |
| Time items One of the following: |
| |
| * H - to break when the hour changes |
| |
| * HM - to break when the hour or minute changes |
| |
| * HMS - to break when the hour, minute, or second changes |
| |
| Date items One of the following: |
| |
| * Y - to break when the year changes |
| |
| * YM - to break when the year or month changes |
| |
| * YMD - to break when the year, month, or day changes |
| |
------------------------------------------------------------------------------------------
For more information on change degrees, see the field descriptions for
the Define Breaks screen in Chapter 16 .
Example: Breaking when the year or month change.
In this example, the report will break when the year or month (YM) of the
ORDER-DATE field change.
MPE/iX 5.0 Documentation