Exercise 6:Define the Linesets [ HP ALLBASE/BRW Tutorial ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Tutorial
Exercise 6:Define the Linesets
You define the linesets for the report in this exercise. You define a
report heading and learn how to use standard items USER, TIME,
REPORT-DESCRIPT, and REQUEST-DATAn; how to print single-value parameters
in a report; how to print the parameters and their run-time values; how
to alter edit masks; how to add prefixes to an item when printed; how to
define a message to be printed in place of an item if that item is zero;
and how edit masks affect the length of an item. This exercise takes 40
minutes.
NOTE The step-by-step instructions in this exercise are less specific
than some previous instructions. You are expected to use what you
learned from previous exercises. If you need additional help, look
at examples from previous exercises or use the Help screen in BRW.
Defining the Report Heading Lineset
You need a Report Heading to print an introduction to the report. This
report heading will print the report name, date and time requested, the
user who requested the report, whether the report reports customers from
one or all sales areas, and the parameters and their values.
Define the report heading
1. Choose Define Lines.
2. Specify R and H (for Report and Heading) when BRW prompts for the
lineset level.
BRW displays the Define Lines screen for the Report Heading.
Add the REPORT-DESCRIPT standard item
1. Type 1 in the line number field.
2. In the line text field, type Report: at character position 1.
3. Type Date: at character position 61.
4. Add the two items REPORT-DESCRIPT and DATE in the Item field.
Place them both on line 1, position them at character position 10
and 67 respectively.
5. Press Enter.
BRW adds the line. REPORT-DESCRIPT is an BRW standard item, and
its value is taken from the Report field on the Define Report
screen.
Your screen should look like the next figure.
Add the USER and TIME standard items
1. Add underlining on line 2 for the text Report: and Date: on line
1.
2. Insert a blank line after line 2
3. Add line 4 to shows who requested the report, and at what time.
In the new line, use the standard items USER and TIME. At run
time, BRW uses the name of the user reqeusting the report and the
time the report is run.
4. Underline the text in line 4.
5. Add an additional blank line.
Your screen should look like this next screen.
Add two report descriptions
You need one description for a report run by a director and a different
description when the report is run by a sales manager.
1. Put this text on lines 7 and 8:
This report prints order details for selected customers in all Sales Areas
in June, followed by the total sales for all Areas in June.
2. Put this text on lines 9 and 10:
This report prints the orders for selected customers in Area
in June, followed by the total sales in June for that Sales Area.
Don't worry that a word seems to be missing after the word Area in
the first line. Later you will add the single-value parameter
?AREA to the line so that the area selected at run time will print
in that spot.
The two lines should be as shown here:
3. Go to the suppress line screen and define suppress line conditions
for lines 7 and 8 as follows:
SELECTION-SET = "SALES-MANAGERS"
(You must enter the value SALES-MANAGERS in uppercase letters.)
4. Define suppress line conditions for lines 9 and 10 as follows:
SELECTION-SET = "DIRECTORS"
(Remember, you must enter the value DIRECTORS in uppercase
letters.)
Print Single-Value Parameters
1. Return to the Define Lines screen.
2. Type ?AREA in the Item field.
3. Type 62 in the Pos. field and 9 in the Line field.
At this position, the area selected at run time will print one
space after the word Area on line 9. If this spacing is not
correct, adjust the positioning of the text or reposition the
parameter.
4. Press Enter.
Print the report parameters and values
The final task on the Report Heading is to print the values for the
parameters.
1. Add a blank line after line 10.
2. Add the three lines of text shown below:
Customers were selected for this report depending upon the values you
gave for the parameters shown below. Note: If CUSTOMER-NO is blank, all
customers are selected.
3. Add another blank line.
4. Type lines creating a heading for the Parameter and Value columns
and underline the headings.
Parameter Value (if any)
--------- --------------
5. Add a final blank line.
Your screen should look like this:
Adding the Standard Items for REQUEST-DATAn
You have now defined the heading for the parameters. You can print the
parameters, and any values for them, using the standard items
REQUEST-DATAn. REQUEST-DATAn prints any parameters and values specified
on the Request Report screen. REQUEST-DATA1 would be the first value
specified on the screen, REQUEST-DATA2 would be the second, and so on.
You can specify up to 50 parameters. In this report, you have only used
two parameters (CUSTOMER-NO and AREA) so you only need REQUEST-DATA1 and
REQUEST-DATA2.
Add the standard items
1. Add the two items REQUEST-DATA1 and REQUEST-DATA2 on the next two
lines, as shown below.
(If you want to see an example solution, look at the report
SOLUTN3.BRWSPEC.ITF3000. (This solution is an example solution included
with the tutorial in BRWEXEC.ITF3000. See Appendix B for more
information about sample solutions.)
Your report heading will now print: the date, time, name of the person
requesting the report, an introduction for either a director or sales
manager showing what data will be reported, and the parameters and their
values.
The Page Heading Lineset
The next lineset to alter is the page heading lineset.
1. Choose Select Lineset.
2. Specify P(age) H(eading) when BRW prompts for the lineset level.
3. Press Enter.
BRW displays the Define Lines screen for the Page Heading.
4. Change the literals on line 1 to read:
Customer Details Report: 3
5. Press Enter.
Your screen should look like the following example:
Level 1 Break Heading and Level 2 Break Heading Linesets
As you can see from your report sketch, there are no changes to the
heading for break on SALES-AREA or the heading for break on CUSTOMER-NO.
You do not need to make any changes to these break levels.
The Detail Lineset
The next lineset to be altered is the detail lineset. The detail lineset
for this report is identical to that of the previous report, except that
the total for order must be amended to print the dollar sign. To do
this, you must alter the item edit for item ORDER-TOTAL.
Look at the item edit for ORDER-TOTAL
1. Choose Select Lineset.
2. Specify the lineset level D (for detail).
BRW displays the Define Lines screen for the detail lineset.
3. Choose Item Edits.
BRW displays the following prompt:
4. Type ORDER-TOTAL.
5. Press Enter.
BRW displays the Item Edit screen for the numeric item
ORDER-TOTAL, as shown below.
This edit mask is for item ORDER-TOTAL, when positioned on line 1,
position 47, on the detail lineset.
NOTE The Line and Position fields edit mask
You can position ORDER-TOTAL (or any other item) as many times as
you like in a report, and each position can have a different edit
mask. Each edit mask affects only how an item will appear when
printed in a certain position.
The edit mask is ZZZZZZZZZZZZ9.99. Note that the item length is 16.
Therefore, the item can have a maximum of exactly 16 characters, that is,
13 numbers before the decimal point, the decimal point, and two numbers
after it. If the number is negative, BRW prints a minus sign before the
number. However, the item's length cannot exceed 16, therefore, negative
numbers can have only 12 numbers before the decimal point. You cannot
define an edit mask that is larger than the item length.
Each 9 denotes a digit. Each Z also denotes a digit, but a digit that is
only be printed if it is significant. That is, leading zeros are not
printed. In the current example, the number 12.90 will be printed 12.90,
not 0000000000012.90. Had the Z's in the edit mask been 9s, then the
leading zeros would not be suppressed.
Add a prefix
You want to add a $ prefix to the number.
1. Type $ in the positive Prefix field.
2. Press Enter.
BRW highlights the Length field and tells you that the edit mask
is too long. You need room for the extra character.
3. Go to the Edit Mask field, delete one of the Z's.
4. Press Enter.
Now BRW accepts the edit mask, and tells you the item edits were
modified.
NOTE You could have also made room for the dollar sign by increasing the
length of the edit mask to 17, rather then by taking away a
possible digit. However, 11 digits before the decimal point still
allows you a maximum number of 99999999999.99: quite large enough
for item ORDER-TOTAL.
Look at the Adjust field
An X in this field means that the prefix or suffix will be printed next
to the number. If the Adjust field is blank, the prefix or suffix will
be printed at the beginning or end of the edit mask, no matter how small
the number.
You want the dollar sign to print directly before the first digit of the
number, so leave the Adjust field unchanged.
Put commas in the edit mask for ORDER-TOTAL
You can use any symbol (except Z or 9) in the edit mask. For this
report, you want to separate the number with commas to make the number
easier to read.
1. Put commas between every three digits, starting with the digit on
the right, replacing the Z at that character position. (Be sure
to count the 9 as one of the digits.)
With commas between every three digits, the first character in the
edit mask would be a comma.
Edit Mask * ,ZZZ,ZZZ,ZZ9
2. Delete the Z that would be a comma at the beginning.
The maximum number for this item is now 999,999,999. For this
report that is sufficient. In other reports you create, you can
change the edit mask to accommodate the maximum number you need
for the report total.
The Edit Mask field should appear as shown in this screen:
Now, if ORDER-TOTAL is 2000.90, it will be printed as $2,000.90. Note
that the leading zeros and commas are suppressed.
Change the edit mask for PRICE
1. Choose Prev Item until the edit mask for item PRICE is displayed.
2. Add a dollar sign as prefix.
3. Delete one of the Z's.
Your screen should look like this screen:
You have now altered all the edit masks for the detail lineset.
The Level 2 Break Footing Lineset
You must now alter the edit mask for item TURNOVER-MTD on the level 2
break footing lineset, that is, the footing for break on CUSTOMER-NO.
Change the edit mask for TURNOVER-MTD
1. Choose Select Lineset on the Item Edits screen.
You can go directly to the Item Edits screen for another lineset.
This feature is helpful here, because the only alterations to be
made to the level 2 break footing are item edits.
2. Choose Select Lineset.
3. Select the lineset level 2.
4. Select F for footing.
BRW displays the Item Edits screen for item CUSTOMER-NAME on the
footing for break on CUSTOMER-NO.
5. Choose Next Item.
BRW displays the edit mask for item TURNOVER-MTD.
6. Add the commas and the dollar sign as you did with item
ORDER-TOTAL on the detail lineset.
Your screen should look like this:
There are no other changes on this lineset.
Change the Item Edit for SALES-AREA.
1. Choose Select Lineset.
2. Select the lineset level 1.
3. Select F for footing.
BRW displays the Item Edits screen for item TURNOVER-MTD on the
break footing on SALES-AREA.
4. Add the commas and the dollar sign as you did with item
ORDER-TOTAL on the detail lineset.
Print a message for a zero value
There is one more alteration to make to this edit mask. Note that the
item TURNOVER-MTD on this break footing is the sum of all the customers
in the area. It is possible, however, that when running the report this
value is zero, because you selected a subset of customers, and the subset
excludes some or all of the customers in a sales area. In this case, you
should print a reminder that the customers reported may be a subset of
all your customers. You can do this by substituting a message for the
item if the item is zero.
1. Look at the field labeled "When zero print text."
You can specify characters in these fields that will be be printed
if the item is zero. You cannot have more characters in this
field than the length of the item.
2. Type the message !!SUBSET ONLY in the first (integer part) field.
3. Type !! in the second (fraction part) field.
4. Press Enter.
Your screen should look like the following screen.
Now whenever this item is a zero, the message "!!SUBSET ONLY!!" will be
printed in the item field, to remind users that they may have selected
only a subset of customers.
You must also alter the actual lineset, so choose Exit to go to the
Define Lines screen.
The existing lineset prints the total for all customers in the sales
area. But this could be misleading in this report, as the user can
select a subset of customers, using the parameter CUSTOMER-NO. You must
therefore emphasize that this lineset prints only those customers
selected, that is, the value of TURNOVER-MTD will be the total for the
selected customers in the sales area.
You can alter line 2 so that it prints the same data, but reminds the
user that a subset of customers may have been selected.
Print a reminder
1. Type the following text in line 2, beginning at character position
1:
Sales for SELECTED Customers in
2. Alter the underlining to match the text.
The report window of your screen should now look like the following
example:
Anyone running this report will be reminded that only those customers
that were selected will be reported upon. They can find out which
customers were selected by looking at the value for parameter
CUSTOMER-NO, which is printed on the report heading.
The Report Footing Lineset
The next lineset to be altered is the report footing lineset.
The existing report footing lineset prints the total for all customers in
all sales area. But, as with the previous lineset, this could be
misleading in this report, as the user can select a subset of customers,
using the parameter CUSTOMER-NO. You must emphasize that this lineset
prints the total for only those customers selected, that is, the value of
TURNOVER-MTD will be the total for the selected customers in all sales
areas.
You can alter line 3 so that it prints the same data, but reminds the
user that the total will be the total of the selected customers.
Change the report footing
1. Go to the Define Lines screen for the report footing.
2. Type the following text in line 3, beginning at character position
4.
Total for SELECTED Customers in All Sales Areas is:
3. Alter the underlining to match.
Now anyone running this report will be reminded that only those customers
that were selected will be reported upon. They can find out which
customers were selected by looking at the value for parameter
CUSTOMER-NO, which is printed on the report heading.
Change the edit mask for TURNOVER-MTD
The final operation is to amend the edit mask for item TURNOVER-MTD.
1. Choose Item Edits.
2. Select TURNOVER-MTD.
3. Add the commas and the dollar sign as you did with item
ORDER-TOTAL on the detail lineset.
Your screen should look like the following screen.
4. Choose Exit to return to the Define Lines screen.
MPE/iX 5.0 Documentation