HP 3000 Manuals

Exercise 8:Using Standard Items [ HP ALLBASE/BRW Tutorial ] MPE/iX 5.0 Documentation


HP ALLBASE/BRW Tutorial

Exercise 8:Using Standard Items 

In this exercise, you specify the date and page in your page heading.
You use the BRW standard items DATE and PAGE. (A list of BRW standard
items is in the HP ALLBASE/BRW Reference Manual.)

The step-by-step instructions do not always tell you every keystroke you
need to make.  For instance, you know how to use Tab or the cursor keys
to move between fields, so this exercise does not tell you to do that.

Put a page number on the report 

   1.  Move the cursor to the Item field.

   2.  Type the standard item PAGE in the Item field.

   3.  Type 11 in the Pos field and 1 in the Line field.

   4.  Press Enter.

       Notice that the upper window of the screen changes to reflect the
       positioning of the page field.  The screen now shows ZZZZZZZZ9
       following the text Page:  on line 1.

[]
The character 9 means that the item is a numeric type, and the character Z means that leading zeros are suppressed. The number of characters indicates the length of the field. The standard item PAGE is nine characters long. BRW determines the item's length and type from the default edit mask (for standard items), or the data dictionary definition (for other items). As the report will certainly not be more than 999 pages long, you can save space by reducing the length of the PAGE standard item to 3 characters. Alter the length of an item 1. Move the cursor to the Len field for PAGE. 2. Type 3 to overwrite the 9. 3. Press Enter. BRW displays a message to tell you that the item has been modified, and cuts the field length on the display.
NOTE If, during the processing of the report, the number of pages exceeds 999, BRW will generate an exception condition to warn you that you need to change the specification of this standard item.
Change the item position on a line You specify an item's position on a line by changing the number in the Pos field. This number shows the character position of the start of an item. BRW will not let you place an item where it overlaps another item or literal. Put the current date on the report 1. Type DATE in the Item field below PAGE. 2. Type > in the Pos field and 1 in the Line field. When you type > in the Pos field, BRW automatically positions the item two spaces after the last item or literal on the line. 3. Press Enter. The date item appears in the upper window as 0m/0d/yy. This is a code or edit mask that tells you how the date will print on the report. Every item printed on a report has an edit mask.
[]
See what the date item mask means 1. Choose other keys. 2. Choose Item Edits. BRW displays this prompt at the bottom of the screen:
[]
3. Type DATE at the Edit-mask for item prompt to see the meaning of the mask for the DATE standard item. 4. Press Enter.
[]
This is the Item Edits screen for the item DATE. The edit mask for DATE is 0m/0d/yy. The m stands for month, the d stands for day, and the y stands for year. The zeros mean that if the month or day is a single digit, then BRW adds a leading zero to the figure. This edit mask will print the date 29 April 1952 as 04/29/52. The edit mask for the DATE standard item is eight characters long (two digits for the month, a slash, two digits for the day, a slash, and two digits for the year), hence the item's length is 8. For other reports you could alter the edit mask if you wish, but for this report, leave it as it is. 5. Choose Exit to return to the Define Lines screen.
NOTE Edit Mask Each item has a separate edit mask for each time it is defined in a line. That is, if you used DATE five times on the same report or lineset, each occurrence has a separate edit mask and you could have each of the five dates print in a different form. Edit masks are further demonstrated in the fourth tutorial lesson in Chapter 5.
Underline the page heading 1. Type 2 in the first field to add text to the 2nd line. 2. Type hyphens that overwrite the literal characters in the text field. (Since you indicated that this line is now line 2, overwriting the literal characters will not modify what you entered for line 1.) The last hyphen corresponds to the last character you typed for line 1, that is, the colon following Date. Don't type hyphens in the blank spaces. 3. Press Enter. BRW adds a second line below line 1, with correctly positioned underlining. Add a blank line to the report 1. Type the line number 3 in the first field. 2. Use the space bar to clear the second field (by spacing over the characters) or press the Clear Line key on your terminal. 3. Press Enter. BRW adds a blank line below line 2. Your final page heading lineset should look like this:
[]

NOTE Clear Display If you had used the Clear Display terminal key to clear the line text line, it would have erased the two standard items also.
You have now defined the page heading lineset. Whenever a new page is printed, the three lines you just defined are printed at the top of the page. The Level 1 Break Heading Lineset From your sketch, you can see that the heading for the first break (on SALES-AREA) must print the name of the sales area. It must also print a heading for the customer details. To define the first break heading, you need to change the Define Lines screen to show the heading for the first break level. Change the lineset level 1. Choose other keys until the Select Lineset function key appears. 2. Choose Select Lineset. BRW prompts you for the new lineset level. 3. Type 1 (for the Level 1 Break) in the (D,P,R,1..9) field. 4. Type H (for Heading) in the (H,F) field. 5. Press Enter. BRW displays the Define Lines screen for the Heading for Break Level 1 on SALES-AREA. Define the level 1 heading 1. Type 1 in the first field. 2. Type Customer Details for Sales Area: starting at position 5 in the line text field. 3. Type SALES-AREA in the Item field, > in the Pos field, 1 in the Line field. 4. Press Enter. BRW automatically aligns the line. 5. Add underlining and a blank line in the same way as you did for the page heading (earlier in this exercise). The screen should look like this:
[]
Add the headings for the detail lines 1. Type 4 in the line number field. 2. Type Customer Number at character position 5, Customer Name at character position 25, and Month's Sales at character position 60. 3. Press Enter. Note that if you placed this heading in the detail lineset, a heading would be printed above every detail. As you only want to print the heading once for each set of customers in a sales area, the appropriate place to print the heading is in the heading for break on SALES-AREA. 4. Underline line 4 and leave a blank line. The final Define Lines screen for the Heading for Break Level 1 on SALES-AREA should look like this:
[]
The Detail Lineset The next lineset to be defined is the detail lineset. Define the lines for the detail lineset 1. Choose Select Lineset. If Select Lineset is not showing, choose other keys until it is showing. 2. Type D (for detail) at the Specify lineset level prompt. 3. Press Enter. BRW displays the Define Lines screen for the detail lineset. From the original design sketch, you can see that the detail lineset is just one line, and contains the items CUSTOMER NO, CUSTOMER-NAME, and TURNOVER-MTD. These items must line up with the headings that you have already defined on the level 1 break heading lineset. You can ensure that the lines line up by copying the heading line from the level 1 lineset. Copy lines 1. Choose Copy Lines. BRW displays the following prompt:
[]
2. Type 4 in the first field. That is the line from the level 1 lineset that contains the customer header information. 3. Type 1 in the second field. That is the lineset level from which you want to copy the line. 4. Type H in the third field. That is the lineset type (Header) from which you want to copy the line. 5. Type 1 in the fourth field. That is the line number to which you want the line copied. 6. Press Enter. BRW copies the fourth line from the 1st lineset header to the first line of the current (detail) lineset.
[]
You can now see where to start the items so that they match the heading. (Later you will delete this line.) The following instructions are purposely brief. Define the items in the same way that you defined the DATE and PAGE items. Add the detail items 1. Type the three items CUSTOMER-NO, CUSTOMER-NAME, and TURNOVER-MTD in the Item field. (You can use the cursor arrow keys to move up and down between the lines of the fields.) 2. Position the items at character positions 5, 25, and 57 respectively. Note that by positioning TURNOVER-MTD at character position 57 you are aligning the last character of the item TURNOVER-MTD with the last character of the literal "Month's Sales". This is because TURNOVER-MTD is a numeric item and is printed from the lowest number to the highest, that is, the field is filled from right to left. If the last character doesn't line up properly, adjust the layout so that it does. (Look at previous tasks to see the alignment shown in the examples.) 3. Indicate that the items are to be placed on line 2. 4. Press Enter. The new line appears in the upper window as shown below. Also, notice that the field length for each item appears in the Len field.
[]
If any of the items are not correctly aligned to the heading, adjust the position by changing the Pos field. Deleting Lines You can see that each item is correctly aligned beneath its respective heading. However, the heading appears on this part of the layout for convenience in lining up the items. It should not remain on this section of the layout. Delete a line 1. Choose other keys until Delete Lines appears. 2. Choose Delete Lines. 3. Answer 1 to the Delete Lines prompt. 4. Press Enter or choose Delete Lines. Line 1 is deleted, and you are left with the one, correctly aligned, detail line in the detail lineset.
[]

NOTE If you left the heading in the detail lineset, a heading would be printed above every detail line. You only want the heading when the sales area changes.
The Level 1 Break Footing Lineset The next lineset to be defined is the level 1 break footing lineset. Go to the Define Lines screen for the break footing 1. Choose other keys until you see the Select Lineset function label. 2. Choose Select Lineset. 3. Specify lineset level 1 by typing 1 at the first prompt field. 4. Type F (Footing) at the next prompt field. 5. Press Enter. BRW displays the Define Lines screen for this lineset. Look again at the report sketch. You can see that the break footing should print the total sales for the sales area. To do that, BRW can calculate the totals for each sales area. Add a column calculation 1. Type 1 in the line number field and Total Sales for Sales Area: in the line text field starting at character position 5. 2. Type SALES-AREA in the Item field, > in the Pos field, and 1 in the Line field. 3. Press Enter. The upper window shows where BRW places the items. 4. Move to character position 52 on line 1 and type is:. 5. Type TURNOVER-MTD in the Item field, > in the Pos field, and 1 in the Line field. 6. Move to the ColCalc field for the TURNOVER-MTD item and type TOTAL. 7. Press Enter. BRW automatically positions the items. When the report runs, BRW calculates the total for all the TURNOVER-MTD values for each sales area.
[]
Other uses for the ColCalc field include calculating the total, average, maximum value, minimum value, or number of values (count) for any numeric, real number, or integer item. The ColCalc field is fully described in the HP ALLBASE/BRW Reference Manual. Add text enhancements Use the skills you have already learned to add these text enhancements. 1. Separate the total line from the previous detail lines by adding a blank line before line 1. 2. Underline line 1. 3. Add another blank line after line 1. Your screen should look like this next figure.
[]
The Report Footing Lineset The final lineset is the report footing lineset. The sketch shows that the report footing will print the total sales for all sales areas. This line will look very similar to the level 1 break footing lineset, except that it will add all the sales for every area. Add a report footing lineset 1. Choose Select Lineset. 2. At the prompt, select lineset R (Report) and type F (Footing). 3. Press Enter. 4. Copy all the lines from the level 1 break footing lineset to the report footing. a. Choose Copy Lines. b. At the prompt, type the number of the lines that you want to copy (that is 1/4) in the first field. c. Type the lineset level, 1, in the second field. d. Type the lineset type, F, in the third field. e. Type the destination line number, 1, in the fourth field. f. Press Enter. BRW copies the lines you just created for the previous task. The Define Lines screen for the Report Footing should look like this:
[]
Edit the lines 1. Go to the Item field for SALES-AREA. 2. Press Clear Line (but do not press Clear Display or you will remove the item TURNOVER-MTD as well.) BRW deletes item SALES-AREA. _________________________________________________________________ NOTE If you are not using a terminal, you may not have a Clear Line key. In that case, just use the space bar to clear the line. Press Enter after you delete. _________________________________________________________________ 3. Press the Next Line function key until line 2 is displayed on the line text field or use the "Quick Browse" feature described in the next section. 4. Change Sales Area: to All Sales Areas 5. Press Enter. 6. Delete the spaces between Areas and is: 7. Move the entire line text string until it is next to the TURNOVER-MTD field. 8. Press Enter. 9. Choose Next Line to display line 3. 10. Edit the underlines until they match the line text on the line above. 11. Press Enter. Your screen should look like this:
[]

NOTE Quick Browse You can use the Quick Browse feature to move directly to a line. Just type the line number in the line number field and press either Next Line or Prev Line. BRW moves directly to the line you request. This is very helpful when you have many lines in a lineset.
The item TURNOVER-MTD in this report footing will total all the occurrences of TURNOVER-MTD in the report (it will not reset until the Report Footing break, which is, of course the end of the report). In comparison, the item TURNOVER-MTD in the level 1 Break Footing will reset after each break on SALES-AREA. (This reset-on-break-level is the default use of ColCalc TOTAL.) Refer to the HP ALLBASE/BRW Reference Manual for details about other reset levels.


MPE/iX 5.0 Documentation