HP 3000 Manuals

Painting the Report [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Self-Paced Training Guide

Painting the Report 

Because the report line headers for the different data managers are
different, report painting is also different.

If you are developing the KSAM based or the HP TurboIMAGE/iX based
application, read on below.

If you are developing the HP ALLBASE/SQL based application, turn to HP
ALLBASE/SQL Based Applications.

KSAM Based and HP TurboIMAGE/iX Based Applications 

The following illustration shows the layout of the line groups and fields
for this report.

[]
To paint the line groups and fields: 1. Paint in the literal text items. You should be able to paint the report with very little assistance. Some of the data fields do require some explanation. The following paragraphs deal with these, a line group at a time. a. Page Heading Group The P1.01 and P1.02 lines contain three data fields. The first field at P1.01 column 69 is the report time. Create this as a standard alphanumeric field. When you enter the field details, specify the contents as *TIME[1,5]. This is a substring of the time that only prints the hours and minutes. The field at column 97 is *PAGENO. The field on the next line at column 69 is *DATE. b. Primary Detail Group The D1.01 to D1.03 lines are printed for each product record found by the report. The D1.01 and D1.03 lines are individual headings for the product details and the option details. The D1.02 line contains all four fields from the product record. These are product_no at column 2, description at column 17, supplier_no at column 59, and lead_time at column 75. Create them using the appropriate field specifications. c. Secondary Detail Group The D2.01 line is printed for each option record that is found by the linkage to the option file. The first five fields are from the option record. These are option_no at column 4, description at column 17, cost at column 49, quantity at column 68, and unit_measure at column 74. Create these using the appropriate field specifications. Make sure that you specify the option file in the Field Name/Literal field for each field specification. Notice that there is no literal text heading for the unit_measure field. This allows the user to read the quantity and unit of measure as one field. 2. Next, you will modify the cost field image to include numeric editing codes for numeric punctuation and the currency symbol. 3. The numeric editing codes control the format of the field data on the report. a. Position the cursor on the cost field image and press the Modify Field function key. b. Enter $NNN,NNN,NNN.NN. This overwrites the field specification definition to one that includes the currency symbol and numeric punctuation. It means that data in the cost field image is printed with a leading currency symbol and commas in the correct locations. 4. The last field on the line is the cost of stock. Create this field image manually at column 81, using the Create Field function key. The source for the field is a calculated item that is totalled into *TOTALS(1). Enter U-option_cost in the Field Name/Literal field and then 1 in the Total Number field. Although you haven't created this item, you can include it in this report. You will create the calculated item shortly. 5. Subtotal Group The T1.01 line is printed whenever the value of the first sort field changes. In this case it is the product number field in the product file. The first data field is the product number read from the product file. Create it using the product_no field specification name. The field is created automatically as required. Description of the Subtotal Lines. The next few paragraphs provide an outline description of the subtotal lines, subheading lines and the data that they use when they are printed. A control break occurs when the value of the sort field on the record read from the primary record changes. Therefore, a control break occurs when the next record is read from the file. This may lead you to think that the new details would be used in the subtotal line group. They are not. HP ALLBASE/4GL uses the previous record details for the subtotal line group and then uses the new record details for any subheading line groups. Therefore the subtotal line prints the product number for the product just listed. The second data field on this line contains the total cost of the options for the product just listed. The field image is identical to the field above it. Enter *TOTALS(1) in the Field Name/Literal field as the name of the data source. If you have used the copy function key to copy the image from the field above it, check to make sure that the other detail fields are satisfactory. In particular, make sure that the automatic totalling field, Total Number, is blank. You may be thinking that using *TOTALS(1) is correct for the first product listed, but from then on it will give a running total for all options listed. This doesn't occur. HP ALLBASE/4GL keeps a matrix of all 16 *TOTALS fields. The number of rows in this matrix is always one greater than the number of sort fields you have specified. There is a separate level of *TOTALS for each control break level, and one for the final value. In this case *TOTALS(1) for the level one control break is being accrued for each option listed. When the level one control break occurs, the value of level one control break *TOTALS(1) is added to *TOTALS(1) for the final total level. The level one control break *TOTALS(1) is then reset to zero. The T1 line group refers to the values of the level one control break *TOTALS fields. The HP ALLBASE/4GL Developer Reference Manual describes the report totalling facilities for reports that use more than one control break. Creating the Final Total Group. The TF.01 line is printed at the end of the report. It contains the total value of all the stock included in the report. It also lists the range of products that have been included in the report. To create the TF.01 line: 1. The first two fields at column 65 and 75 are almost identical. Create their images by using the product_no field specification. 2. Modify their respective field details to change the name of their data sources; the Field Name/Literal field should refer to * S01 for the field at column 65, and the field at column 75 should refer to *S02. You can include the screen fields on the current screen in a report. 3. The third field at column 83 is identical to the field above it on line T1.01. Make a direct copy of it to speed up the painting procedure. Remember that this time the value of 4. TOTALS(1) is the final total value accrued over the whole report. Extra Line Group The E1.01 line is only printed by the print_option function when no options have been found for a particular product. It only contains one literal field. 5. Once you have painted each of these lines, exit from the report painter. The report painter automatically saves the image of the report. Before you generate the report, you must define the calculated item used in line D2.01. This is described in the next lesson. Now turn to the summary of this lesson. HP ALLBASE/SQL Based Applications The following illustration shows the layout of the line groups and fields for this report.
[]
To paint the line groups and fields: 1. Paint in the literal text items now. You should be able to paint the report with very little assistance. Some of the data fields do require some explanation. The following paragraphs deal with these, a line group at a time. 2. Page Heading Group The P1.01 and P1.02 lines contain three data fields. The first field at P1.01 column 69 is the report time. Create this as a standard alphanumeric field. When you enter the field details, specify the contents as *TIME[1,5]. This is a substring of the time that only prints the hours and minutes. The field at column 97 is *PAGENO. The field on the next line at column 69 is *DATE. 3. Subheading Group The H1.01 to H1.03 lines are printed for each product record found by the report. The H1.01 and H1.03 lines are individual headings for the product details and the option details. The H1.02 line contains all four fields from the product record. These are product_no at column 2, description at column 17, supplier_no at column 59, and lead_time at column 75. Create them using the appropriate field specifications. 4. Primary Detail Group The D1.01 line is printed for each option record that is found by the linkage to the option file. The first five fields are from the prod_opt select list. These are option_no at column 4, opt_descript at column 17, cost at column 49, quantity at column 68, and unit_measure at column 75. Create these using the appropriate field specifications. Notice that there is no literal text heading for the unit_measure field. This allows the user to read the quantity and unit of measure as one field. 5. Modify the cost field image. You must modify the cost field image to include numeric editing codes for numeric punctuation and the currency symbol. The numeric editing codes control the format of the field data on the report. a. Position the cursor on the cost field image and press the Modify Field function key. b. Enter $NNN,NNN,NNN.NN. This overwrites the field specification definition to one that includes the currency symbol and numeric punctuation. It means that data in the cost field image is printed with a leading currency symbol and commas in the correct locations. 6. The last field on the line is the cost of stock. Create this field image manually at column 81. The source for the field is a calculated item that is totalled into 7. TOTALS(1). Enter U-option_cost in the Field Name/Literal field and then 1 in the Total Number field. Although you haven't created this item, you can include it in this report. You will create the calculated item shortly. 8. Subtotal Group The T1.01 line is printed whenever the value of the first sort field changes. In this case it is the product number field in the product file. The first data field is the product number read from the product file. Create it using the product_no field specification name. The field is created automatically as required. Understanding Subtotal Lines. The next few paragraphs provide an outline description of the subtotal lines, subheading lines and the data that they use when they are printed. A control break occurs when the value of the sort field on the record read from the primary record changes. Therefore, a control break occurs when the next record is read from the file. This may lead you to think that the new details would be used in the subtotal line group. They are not. HP ALLBASE/4GL uses the previous record details for the subtotal line group and then uses the new record details for any subheading line groups. Therefore the subtotal line prints the product number for the product just listed. To create the second data field: The second data field on this line contains the total cost of the options for the product just listed. The field image is identical to the field above it. 1. Enter *TOTALS(1) in the Field Name/Literal field as the name of the data source. 2. If you have used the copy function key to copy the image from the field above it, check to make sure that the other detail fields are satisfactory. In particular, make sure that the automatic totalling field, Total Number, is blank. You may be thinking that using *TOTALS(1) is correct for the first product listed, but from then on it will give a running total for all options listed. This doesn't occur. HP ALLBASE/4GL keeps a matrix of all 16 *TOTALS fields. The number of rows in this matrix is always one greater than the number of sort fields you have specified. There is a separate level of *TOTALS for each control break level, and one for the final value. In this case *TOTALS(1) for the level one control break is being accrued for each option listed. When the level one control break occurs, the value of level one control break *TOTALS(1) is added to *TOTALS(1) for the final total level. The level one control break *TOTALS(1) is then reset to zero. The T1 line group refers to the values of the level one control break *TOTALS fields. The HP ALLBASE/4GL Developer Reference Manual describes the report totalling facilities for reports that use more than one control break. 3. Final Total Group The TF.01 line is printed at the end of the report. It contains the total value of all the stock included in the report. It also lists the range of products that have been included in the report. To create the final total group: 1. The first two fields at column 65 and 75 are almost identical. Create their images by using the product_no field specification. 2. Modify their respective field details to change the name of their data sources; V-first_product and V-last_product. 3. The third field at column 83 is identical to the field above it on line T1.01. Make a direct copy of it to speed up the painting procedure. Remember that this time the value of 4. TOTALS(1) is the final total value accrued over the whole report. 5. Once you have painted each of these lines, exit from the report painter. The report painter automatically saves the image of the report. Before you generate the report, you must define the calculated item used in line D1.01. This is described in the next lesson.


MPE/iX 5.0 Documentation