Defining the Product Report

Let’s take a moment to review what you have accomplished.

A. You began by defining a simple Customer file. Then you added some customer data. Next you re-defined the Customer file, adding more fields and field types, to make it more useful.

B. You have created a custom data-entry screen to dress up the application and make it nicer for the end user to work with.

C. Next you defined processing tables to perform date calculations, insure that a unique customer number was entered, and displayed a browse window of valid state postal abbreviations.

D. After completing the data-entry for the customer file you went on to define a state tax file to hold tax rates.

E. For the state tax file you created a new edit type called “rate” to insure that the data-entry conformed to specific rules. Then you added data to the state tax file.

F. As the final step, you created a product file. You modified the default data—en-try (Screen 0) and created processing tables to assist the data—entry. Next you added data to the product file.

 

Now you are going to learn how to create a report with filePro Plus. filePro Plus’s report writer is one of the easiest to use and one of the most powerful available on the market.

In filePro Plus you can create a report that can have a maximum of 255 characters per line and print a maximum of 255 lines per page. You have complete control over the number of lines per page, how the titles, column headings and totals will appear.

 

Let’s start with a simple report now, and then get fancy later on.

1. From the main menu select option “3 - Define Output”.

2. For the file, select “PROD” from the menu.

3. For the output format name, select “[NEW]”, then type: "report" and press <RETURN>.

You will see a menu of the kinds of output filePro plus can perform.

The five format options as depicted in figure 18-1.

image\fig18-1.gif

Table 18-1. Output Format Options

Choose "1 - A report".

4. At the format options screen (“width of page:,” etc.) press <ESC>. For sort field, press "1", for “product code”, and press <ESC>.

5. We are now at the format screen (“HEADING/TITLE LINES,” etc.) Now let’s design our report. We’ll keep it simple by placing all our fields on one line.

Like the “Define Screens” option, filePro Plus’s report writer uses field indicators. There are four:

 * or ! indicates any field
 = total this field
 < pushes field left.

6. The cursor is in the “HEADING/TITLE LINES” area at the left margin. We want to create a heading in the center of our report. To do this press <TAB> four times.

7. The cursor should be at position “1,33”. Type:

 PRODUCT REPORT

Press <RETURN>.

8. Now type:

 Date: !@DT

(“@DT” is one of the system-maintained date fields in filePro Plus (see the fPmanual)). When the report is printed, the current date will be printed starting in the space indicated by the “!“.

9. Now press <Tab> six times to get to position “2,59” and use the right arrow to move the cursor to “2,65”. Type:

 Page: <@pn

The field indicator, "<",tells filePro Plus to leave only one space between the following field and the previous field or literal. Since the page number field (@PN) is normally eight characters, the "<" will eliminate all but one blank.

10. Press <RETURN> twice to move the cursor to position “4,1”. Now type:

 CODE

11.Move right to “4,6” and type:

 DESCRIPTION

12. Move right to “4,23” and type:

 PRICE

13. Move right to “4,31” and type:

 QTY

14. Move right to “4,36” and type:

 SOLD

15. Move right to “4,42” and type:

 UNIT-COST

16. Move right to “4,52” and type:

 TOT-VALUE

17. Move right to “4,62” and type:

 PROFIT%

18. Move right to “4,71” and type:

 P TOT-PROFIT

The cursor is now at position “1,1” of the “DATA LINES” area. Press the up arrow key to move the cursor back up into the “HEADING/TITLE LINES” area, position “4,1”.

19. Let’s dress up our report a little by separating our title from our column headings. First, we’ll make our title area larger. Press <F8> to call up the Extended Functions menu. At the menu, press <G>. The word, “Grow” appears, in reverse video, in the lower right corner of the screen. Now press <F3> to insert a line. Position the cursor to “5,1” and hold down the < - > key until you get to “5,80”. Press the < -> key once more. You just created a line of dashes. You are now in the “Data Lines” area.

20. Type in the field indicators as shown in the illustrations that follow. Each field indicator (*or!) is two lines down and directly under the first letter of its related field heading.

image\fig18-2.gif

Figure 18—1 Define Output Formats Screen

(Product Report Format)

21. After you have typed in the fields and indicators, notice that there are two lines in the data area. We are using only one. If you wish to eliminate the blank line between each printed line of the report, position the cursor on the line above the blank line and press <F4> while you are still in “Grow” mode. In any case, move to the grand total line and at column position “1,1”, type:

 Products Listed: *@ts

22. (@TS is the total number of records selected). Move to “1,29” of the grand total area, and type:

 Total Value: =7

23 The field indicator, “= “, tells filePro Plus to print the sum of field 7 for the records selected. Move the cursor to “1,57” and type:

 Total Profit: =tp

This will sum the profits made for the products sold.

24. Save the report format by pressing <ESC>. Return to the main menu by pressing <X>.