The BandIT© Report Writer

End-User Version 1.0

February 1994

(C) Copyright 1992-94 Programmers Warehouse, Inc. (C) Copyright 1992-94 The Fieldston Consulting Group, Inc.

Table of Contents

Reporting Basics	1

Databases and Relations	1

Sorting and Grouping	2

Report Lines	4

Calculated and Total Fields	6

Queries	6

Running the Report	7

Creating Your First Report	8

Creating a New Report	8

Adding Fields	9

Adding Page Headers	9

Adding a Date and Time	10

Moving a Field	10

Entering Text	11

Sorting the Report	11

Saving the Report	12

System Menus	13

Field Menu (/Field)	13

Calculate	13

Total	14

Width	15

Format	15

Justify	15

Attribute	15

Trim	15

Remove	16

Line Menu (/Line)	17

Create	17

Insert	17

Delete	17

Move	17

Replicate	17

Justify	19

Print	19

Trim	19

Slide	21

Database Menu (/Database)	21

Master	21

Relation	21

Scope	22

Index	22

Query Menu (/Query)	22

Print Menu (/Print)	26

Configure	26

Destination	29

Run	29

Report Menu (/Report)	30

Load	30

Save	30

Create	30

Sort-Group Menu (/Sort)	30

Sort	30

Group	30

Duplicate	30

Revert	30

Clear	30

Options Menu (/Options)	31

Directories	31

Move-Size	31

Zoom	31

Remove	31

Squeeze	31

Jump-Start	31

Printer-Table	31

Creating Labels	32

Basic Painter Keyboard Shortcuts	34

Reporting Basics

The BandIT© Report Writer program allows you to easily design your report by placing database fields on a design screen. You can sort the data, have headers and footers, and create summary information. Use the easy Query builder to extract only the portion of data that you need. Then print your report to a wide variety of printers, display it on screen, or save it into a file. You can save your reports in separate report files.

This section of the report writer manual introduces the various concepts involved in creating and running your own reports. The next section will teach you how to create a simple report Then each commands on the menu is discussed in detail. The last page is a list of shortcut keys available while using the report writer.

Databases and Relations

Before you can create a report, you must first decide where the data used in the report will come from. All reports contain at least one 'master' or controlling database. This file will be used to control how records will be retrieved during report creation.

When the information used in your report is in more than one file, you must create a 'relation' between the files. Relations allow you to look at data from multiple files as if it were in a single 'composite' or combined record.

Relations are set from one file into another based on a common value known as a 'key' or 'link-field'. The file the relation is set from is called the 'parent' database, and the file the relation is set into is called the 'child' database.

For example, assuming you have two databases; one of Customers, and another of all their Orders. Each customer can be identified by a unique number stored in the field CUST_NO. The Orders database also has a field CUST_NO which indicates the customer a particular order belongs to. If you wanted to see each order for each company, you would set a relation from Company into Orders based on the key field CUST_NO. This chart shows the database structures of the two databases in column 1 and 2. Column 3 shows the composite record when the two files have relations set.

CUSTOMERS.DBF

ORDERS.DBF	The composite record would have the fields
CUST_NO	CUST_NO	CUST_NO
NAME	ORDER_NO	NAME
ADDRESS	ORDER_DATE	ADDRESS
CITY	CITY
STATE	STATE
ZIP	ZIP
ORDER_NO
ORDER_DATE

There are four types of relations:

Scanning	- Finds all matching records in the child.

Exact	- Finds first matching record in the child.

Approximate	- Finds first approximate matching record in the child.

Record Number	- Go to a specific record number in the child.

Body Lines in a report are generated for each possible composite record. If the relation used above were a Scanning relation, each Order of each Customer would create a separate composite record. For example, if Customer #1234 had placed 3 Orders, then 3 composite records would be created. If the relation were Exact then only 1 composite record would be created since only the first matching record in the child is used, regardless of the actual number of matching records it contains. This composite information can then be placed on your report in the Body Lines, or as heading or footer information.

Sorting and Grouping

Sorting refers to the order in which the data will be placed before creating output. A report can be sorted on any field, including calculated fields, total fields, or fields from related files. For example, a report sorted on CUST_NO and then by ORDER_NO might produce output like:

Customer	Order

------	------

000001	777777

000001	888888

000001	999999

000002	444444

000003	111111

000003	222222

000003	333333

You can see that the printed output is first sorted by the customer number, and then within each customer by the order number.

Grouping refers to the places in a report where totals are accumulated and group header and group footer lines produced. Group levels are field based, meaning a group is based on the value of a specific field. For example, if you wanted one set of subtotals for each Customer and another set of subtotals for each Order, you would create two group levels; one on Customer number and a second on Order number.

Although sorts and groups are independent of each other, it is common for them to be set up in the same order. For example, if you are sorting a report by CUST_NO and ORDER_NO, it is likely you will want subtotals broken out in the same order. It is also possible to set up group levels without having sorts defined. If you have an available index on the master database which is already in the order you want, you can dramatically speed up report processing by using this index instead of having the system sort the report for you.

During report creation, a check is made to see if any changes have occurred in group level fields. If there has been a change, then a group break has occured occurred. When more than one group is defined in a report, multiple breaks will occur at the same time. For example, if your report is grouped on CUST_NO and ORDER_NO, then by definition when a break occurs in CUST_NO, a break must also occur in ORDER_NO. All breaks are inclusive of the levels below them.

When breaks occur, subtotal fields are updated and group footer lines for the levels are generated. (Generated lines may also be printed, if specified by the designed report.) The subtotals are then reset and group header lines are generated. This means if a break occurred at ORDER_NO, subtotals based on ORDER_NO would be updated and any group footer lines for this level would be generated. These subtotals would then be reset to 0 so they accumulate properly for the next group. Any group header lines for this level are then generated.

Report Lines

Report Lines are used to control how report information will be output. There are 7 types of lines:

Title	- Appear only once during report generation, at the start of report output.

Page Header	- Generated once at the start of the report and at every page break thereafter.

Header	-Generated for each group level when a new group is encountered.

Body	- Generated once for each composite record.

Footer	- Generated for each group level after group information has been processed.

Page Footer	- Generated at the bottom of every page.

Summary	- Appear only once during report generation, at the end of report output.

Here is a sample report that contains lines of varying types.

The first line is a Title Line which will appear on the first page only. The next two lines are Page Headers and will appear at the top of every page. Following these is a Group Header for group level 1. It will appear at the start of each Customer. The next three lines are Group Header for group level 2. These will appear at the start of each Order.

The next line is a Body Line and will appear once for each composite record (in this case, each Item of each Order of each Customer). The following line is a Group Footer for group level 2. It will appear at the end of each Order. The next is a Group Footer for group level 2. It will appear at the end of each Customer. The a Group Footer for group level 1, or each Company.

You can also have other lines, which are not shown on the screen, but available on the report. (You use the arrow keys to scroll the report window to view the additional lines.) Following the Group Footers is a Summary Line which will appear only once, at the very end of the report. The last two lines are Page Footers and will appear at the bottom of every page.

Calculated and Total Fields

There are two types of fields that you can create for inclusion in a report: Calculated and Total fields.

Calculated fields are the result of an expression or calculation which is evaluated as the report is created. This expression is defined when you first create the field and can contain references to any other field used in the report including totals and other calculated fields. Calculated fields may be used anywhere in a report exactly as if they were real fields in a real database.

For example, if you wanted to create a calculated field that multiplied the number of items ordered by the price of the item, you might create a calculated field named 'COST' using the expression:

Items->QTY * Stock->PRICE

If you then wanted to give everyone who ordered a 10% discount you might create another calculated field named 'DISCOUNT' using the expression:

_VIRTUAL_->COST - (_VIRTUAL_->COST * .10)

When you build an expression using calculated fields, they must always be prefixed with the alias specifier '_VIRTUAL_'. This defines a field as a calculated fields, rather than a field from a database.

Total fields are the result of the accumulation of some field as the report is created. There are three basic types of totals:

Group	- Total values within a group. The total is reset whenever a new group level is encountered.

Page	- Total values within a page. The total is reset whenever a page break occurs.

Grand	- Total values throughout the entire report. Grand totals are never reset.

Total fields may be based on any field used in the report, including other total fields. If you wish to sort on a total field you must define it as PREPROCESSED.

Queries

You can use Queries to filter or extract the information your report will contain. Only those composite records matching the query criteria will be processed during report generation. For example, if you wanted a report which only contained orders past a certain date, you would use a query to tell the system to ignore all records whose order date was before the one you want.

The report writer allows you to easily build the filter condition. This is covered in the next section.

Running the Report

When the report is built, a simple command allows you to run the report. The report writing program supports many different kinds of printers. Or you can "print" the report to the screen, or save the printed report in a file.

You have complete control over the printed output. You can specify margins, the characters per inch, width of the report, whether the report is printed in landscape or portrait orientation, and the number of copies to print. You can also easily create labels of various types.

The next section of the manual includes information on configuring the printed output of your report.

Creating Your First Report

Now that you have reviewed the basic components of a report, you are ready to create your first report. The examples in this section assume that you are working with a database called COMPANY.DBF. You can select any database as the 'master' database. Just substitute your database for COMPANY.DBF, and the field names in your database for the field names in the sample COMPANY database.

Most actions in the reports writer are started by selecting a choice from the menu. You can select menu options in several ways:

- use the arrow keys to highlight your choice and press [Enter]

- select a command by pressing the first letter of the command

- select a command by pressing the "/" key, and then press the first letter of the command

If you haven't done so, start the report writing program. You'll see an opening credit screen, as in the figure above.

Creating a New Report

After pressing a key in the opening credit screen, select the 'Create' option from the menu and you will be presented with a list of available databases. Select the file 'COMPANY.DBF' (or your own database). This will be used as the 'master' or controlling database for the report. After selecting the master file, you will be prompted to enter the alias to use when accessing fields from the database. Press [ENTER] to accept the default alias of 'COMPANY'. This will place you in an empty report with a single body line.

This will display the report design screen, as shown in the figure. The design screen has an area at the top for the command menus, and a design area to place the fields and text on the report.

Adding Fields

Now let's place some fields in the report. Press [F7] to get a picklist of available fields and select 'COMPANY_NO'. This will drop the field at the current cursor position.

(This is important to remember: whenever you select a field, or create a calculated or total field, the field is placed at the current cursor position on the design screen. You will want to get into the habit of first putting the cursor at the correct location, then selecting or creating a field.)

Press the right arrow key twice, then [F7] again, and select the field 'NAME'. You should now have two fields on the report with a single empty space between them.

To run the report and see what the output looks like, select 'Print' from the main menu and then the 'Run' sub-option. If you have used the CUSTOMER database, it should look something like this:

000001 Ratty Software Corp.

000003 OK Gifts Inc.

000004 MOMAs Pizza

000002 Clipper Life Rafts Inc.

000005 Smokin' Joes Baseballs

000006 Solid Waste Management

When you have finished viewing the output, select 'Quit'.

Adding Page Headers

Now let's pretty the report up a little. First, we're going to add a few lines that will print at the top of each page. To create a new line, select 'Line' from the main menu and then the 'Create' sub-option. When prompted to choose the type of line to create, select 'Header'. Since no group levels are defined the only option available will be 'at the top of each new page'. Press [ENTER] to select it, and then press [ESC] twice to exit the menu system. This will leave you on the newly created Header line. Now press [ALT-A] twice to add two more Header lines. [ALT-A] is a keyboard shortcut for adding lines of the same type as the current one.

Adding a Date and Time

We are now going to create two new fields; one for the current date and another for the current time. These are known as 'calculated' fields, since their values are obtained from an expression while the report is running, instead of from a database file. Select the 'Field' option from the main menu, and then the 'Calculate' sub-option.

Since we want to define a new field, select 'Create'. You will then be prompted to enter a name for the field. Type "Today" and press [ENTER]. When prompted for an expression type "date()" (without the quotes) and press [ENTER]. The date field will appear in the report at the current cursor position and the 'Create' menu option will be highlighted.

Press [ENTER] again since we have one more field to define. This time for the field name enter "Now", and for the expression enter "time()". When you have completed creating the field it will also be placed in the report, directly on top of the field 'Today'. (Again, creating a field places it at the current cursor location on the report. You may want to get into the habit of moving the cursor to the spot where you want the field to be placed, then create the field.) Now press [ESC] twice to exit the menus and get back into the design screen.

Moving a Field

Since we have overlapping fields let's move the 'Now' text down a line. To do this press [ENTER] on the field, then the down arrow key, and then [ENTER] again. Whenever the cursor is on a field, pressing [ENTER] will begin/end the moving of that field. You should now have a report that looks similar to the Figure.

Entering Text

To enter text into a report, move the cursor where you want the text to appear and begin typing. When you have finished press [ENTER] to accept your entry, or [ESC] to cancel. Pressing [ENTER] will create a new 'text' field. Text fields are just like any other field except they have static values (ie. they do not change during report generation) and they cannot be accessed from within expressions. You may move, format or resize them exactly as you would any other field. To edit a text field, move the cursor onto the field and press [F2]. Then delete or add new characters to change the text for that field.

Let's add some text to our page headers so we know what this report is when we print it. Move the cursor to the middle of the first Page Header line and type "Company Listing" and press [ENTER].

Sorting the Report

Let's see what this report would look like if we sorted it on 'COMP_NO' (Company Number). Select 'Sort-Group' from the main menu and then 'Sort' from the sub-menu. A picklist of available fields will appear. (You may want to reference the data dictionary in your application's user manual for a list of the fields and their descriptions.) Select the field 'COMP_NO' and press [ENTER]. When prompted to specify the sort order press [ENTER] to accept 'Ascending'. Now press [ESC] twice to get back to the main menu. Let's run the report again. This time you will be prompted if you want to resort the report; select 'Yes'.

12/31/93 Company Listing

23:59:59

000001 Ratty Software Corp.

000002 Clipper Life Rafts Inc.

000003 OK Gifts Inc.

000004 MOMAs Pizza

000005 Smokin' Joes Baseballs

000006 Solid Waste Management

When you have finished viewing the output, select 'Quit' to return to the main menu.

Saving the Report

To save your work, select the 'Report' option from the main menu, and then the 'Save' sub-option. Enter the name to save this report under and press [ENTER]. The report name is a standard DOS filename of eight characters. A file extension of ".RH1" will be added unless you specify the extension. For instance, if you type in "MYREPORT" as the report name, the actual file name of the report will be MYREPORT.RH1. The report files are saved in the current directory, unless you specify a different directory.

System Menus

This section of the manual has short descriptions of all the menu choices available in the report design screen.

Field Menu (/Field)

Calculate

Calculated fields are the result of an expression which is evaluated as the report is created. These fields may be used exactly as if they were real fields in a real database. When accessing a calculated field from within an expression it must always be prefixed with the alias '_VIRTUAL_'. This is used to differentiate a calculated or total field (see below) from a field in a database.

For example, if you created a calculated field named 'Cost' and wanted to access it from within another expression, you would enter it as '_VIRTUAL_->COST'. When selecting this field from picklists it will also appear as '_VIRTUAL_->COST'.

These choices are available for calculated fields:

Create - Allows you to define a new calculated field. When prompted, enter the name you wish to use for this field. This name must be unique (ie. not already used), may be no longer than 10 characters, and may not contain any characters other than letters, numbers and the underscore character.

Once the name has been entered you will be prompted to enter the expression which defines the value this field will return. For example, if you wanted to multiply the values of two database fields you might enter "ITEMS->QTY * STOCK->PRICE". (In these examples, you should not type in the quote characters.)

Edit - Allows you to edit an existing calculated field. Select the field from the list, then edit the field name or expression.

Delete - Allows you to remove a calculated field from the report. If any other fields are dependant on the one being deleted, you will be prompted to continue before removing all such fields. Available fields are shown in a pick list.

Total

Total fields are the result of the accumulation of some field as the report is created. Whenever the field break level (group) is encountered, the value being accumulated is reset. This field can be accessed as if it were an actual field in a database and may be used in all expressions other than relations and queries.

For example, if you had a report which was grouped on State and Region, and wanted a subtotal that accumulated a value for each Region, you would create a total field of group level 2 (Region). Like calculated fields, you must always prefix total fields with the alias '_VIRTUAL' when accessing them from within other expressions.

These choices are available with the /Field, Total command:

Create - Allows you to define a new total field. When prompted, enter the name you wish to use for this field. This name must be unique (ie. not already used), may be no longer than 10 characters, and may not contain any characters other than letters, numbers and the underscore character.

Once the name has been entered you will be prompted to select the type of total being created. Valid field total types are;

SUM	will total the value of a numeric field.

COUNT	will count the number of non-blank entries for a field.

AVERAGE	will average the values of a numeric field.

LOWEST	will maintain the lowest field value encountered.

HIGHEST	will maintain the highest field value encountered.

DEVIATION	will compute the standard deviation a field.

VARIANCE	will compute the variance of a field.

Once the total type has been selected you will be prompted to select the field you want to total. After selecting the field to total you will be shown a list of currently defined break (group) levels. These levels represent the point during report generation that the value of this total field will be reset. In addition to group levels, two other options will appear in this list allowing you to reset the total at each page break, or to never reset it (grand total).

Edit - Allows you to edit an existing total field. This works just like editing a calculated field.

Delete - Allows you to remove a total field from the report. If any other fields are dependant on the one being deleted, you will be prompted to continue before removing all such fields.

Process- Allows you to specify when the total field should accumulate. A RUNNING total field will be accumulated as report output is created. A PREPROCESSED total field will be accumulated first, then report output will be created. This lets you perform operations like sorting on totals, or doing percentages of totals.

Width

Allows you to resize the currently selected (highlighted) field. Fields must be at least 1 character wide. If the cursor is not on a field, no action is taken. You can enter a number for the width of the field, or use the left/right arrow keys to increase or decrease the field's width.

Format

Allows you to specify the format to apply to the currently selected field. Formats are used to change the appearance of a fields value. For example, a numeric field formatted with 'Fixed()' might appear as '12345.67 and another formatted as Currency() might appear as '$12,345.67. If the cursor is not on a field, no action will be taken.

Justify

Allows you to specify the type of justification to apply to the currently selected field. All values of this field will be justified within the width of the field. Valid justification types are:

LEFT	- Left justify field value.

RIGHT	- Right justify field value.

CENTER	- Center field value.

FULL	- Justify field value end-to-end.

DEFAULT	- No justification is performed.

Justification is the last operation performed on a field. When justifying a word-wrapped field, each line of text extracted from the field will be justified within the field's width. If the cursor is not on a field, no action is taken.

Attribute

Allows you to specify the printer attribute to use on the currently selected field. There are three basic printer attributes: Bold, Italic and Underscore. You may choose any combination of these attributes, providing your printer supports it. This option is only valid if the cursor is on a field.

Trim

Allows you to specify that the output value or the currently selected field should be placed flush against other fields which are directly next to it. For example, given the following two fields in a report line:

Last Name First Name

The output might look like

with Trim ON : SmithJohn

with Trim OFF: Smith John

This happens because the two fields are placed right next to each other. If one field is moved away from the other, the output will look like the "Trim Off" choice above.

Remove

Allows you to remove the currently selected field from the report line. If the cursor is not on a field, no action is taken. Once the field is removed, it can't be un-removed. You can use the [F7] key to use the picklist to put the field back on the design screen.

Line Menu (/Line)

Create

Allows you to define a new report line. There are 7 types of lines:

Title	- Appear only once during report generation, at the start of report output.

Page Header	- Generated once at the start of the report and at every page break thereafter.

Header	- Generated for each group level when a new group is encountered. If available, you will be presented with a list of groups to select from.

Body	- Generated once for each composite record.

Footer	- Generated for each group level after group information has been processed. If available, you will be presented with a list of groups to select from.

Page Footer	- Generated at the bottom of every page.

Summary	- Appear only once during report generation, at the end of report output.

If no line of the selected type exists in the report the newly created line will be placed at the appropriate place in the report. If a line of the same type does exist, the new line will be added and you will be prompted to position the line using the cursor keys.

Insert

Allows you to insert a new line above the current one (the one the cursor is on). This line will be of the same type and group level as the current line. You may delete a single line in the painter using [ALT-I].

Delete

Allows you to delete lines from the report. Select the lines to delete using the cursor keys and press [ENTER]. You may delete a single line in the painter using [ALT-R].

Move

Allows you to move lines from one place to another within the report. Select the lines to move using the cursor keys and press [ENTER]. Once selected, you will be prompted to choose a new type and group level for these lines.

Replicate

Allows you to duplicate on set of lines elsewhere in the report. Select the lines to replicate using the cursor keys and press [ENTER]. Once selected, you will be prompted to choose a new type and group level for these lines.

Justify

Allows you to justify all fields contained on a line, within the line length. This justification is a one time only event. It will not force the output of fields contained on the line to be justified as the report is produced.

Print

The /Line, Print command allows you to change how the selected lines are printed, including their attributes, insert a page break, and conditionally print lines depending on the contents of a field in your database.

Attribute

Allows you to specify the printer attribute to use for all fields on selected lines. There are three basic printer attributes: Bold, Italic and Underscore. You may choose any combination of these attributes providing your printer supports it.

Once you have chosen the printer attribute to apply, all fields contained on the selected lines will have their attributes changed. Any new fields added to this line will remain unaffected.

New-Page

Allows you to define a new-page line which are used to force page breaks to occur at a specific spot in the report. For example, if your report were grouped by State and you wanted each State to start on a new page, you would create a group footer line for State and then make it a new-page line. New-page lines may not contain any fields.

Filter

Allows you to define a filter to conditionally print selected lines during report creation. For example, if you only wanted certain lines to appear if some value was greater than zero, you would attach a filter to those lines.

After selecting the lines to operate on, you will be prompted to either Set or Clear filters. Clearing lines filters will enable all selected lines to appear in report output.

If you choose Set, you will be prompted to select the field to base the condition on, and then whether the lines should print when the field is Empty or Not Empty.

Trim

Allows you to specify that the output values for all fields on selected lines should be placed flush against other fields which are directly next to then. For example, given the following two fields in a report line:

Last Name First Name

The output might look like

with Trim ON : SmithJohn

with Trim OFF: Smith John

Slide

Allows you to move the current line up or down within lines of the same type and break level.

Format

Toggles the display format of fields on the current line. Fields may be displayed using either the field name, or a value representing the field's data type.

Database Menu (/Database)

Master

This allows you to select a new master database for the report. This file should have the same structure as the current master file. When you select this option you will be presented with a list of databases to choose from. Once you have selected the file you want to be the new master database, you will be prompted to enter an alias to use. You can enter a new alias or press [ENTER] to accept the default value.

Relation

Allows you to add/edit/delete relations used in the report. When you choose this option you will be placed in a picklist of databases used in the report. Select the database to operate on and press [ENTER]. You will then be placed in a picklist of relations from this file. If none exist a blank line will be highlighted. Pressing [ENTER] on a blank line will set a new relation.

The first thing that must be specified when setting a relation is the linking field to use when searching the related file. Select the field and press [ENTER]. You will then be prompted to select the database to relate to. After selecting the database you will be prompted to enter an alias to use. You can enter a new alias or press [ENTER] to accept the default value.

You must then select the type of relation to set. This will determine how records in the child database are accessed. There are four types of relations:

Exact	- Finds first matching record.

Scan	- Finds all matching records.

Approx.	- Finds first approximate matching record.

Recno	- Go to a specific record number.

If you choose any relation type other than Recno you will be prompted to select an index file to use when searching the related file. After selecting the index a list of tags from within that file will be shown. Select the tag to use and press [ENTER].

You will then be prompted to select a failure action for the relation. Failure actions are used to control what happens when no match is found in the related file. There are three types of failure actions:

Blank	- Use a blank record from related file.

Skip	- Go to next record in parent file.

Terminate	- Terminate the report completely.

After selecting the failure action you must select a match type. The match type allows you to specify that either a Full or Partial match should be made against the value in the related file. For example, if you set a relation on the field CUST_NO but only wanted to match on the first 4 characters, you would set a Partial relation.

Scope

Scopes can be used to dramatically increase the performance of your reports. For example, if you had an index for the master file on LAST_NAME and only wanted to report on people who's last name started with "C" thru "F", you could use a scope instead of a query to filter out the data you don't want. Scopes are only valid for the master database, and when you have specified an index for the master database.

If no master index is present you may set scopes based on record numbers in the master database. For example, if you only wanted to report on records 10 thru 15 you would set the Low Scope to 10 and set the High Scope to 15.

Index

This is used to set the index file for the master database. A master index can be used to control the order in which report output is created or it can be used in conjunction with a scope.

Query Menu (/Query)

The Query menu allows you to select a portion of the database based on conditions you specify. For instance, you may want to select all customers in one state, or a list of states. Or you could select those customers in one state who owe more than $1000. You build the query by selecting the field (such as STATE), the condition (such as Equal To), and the value (such as "CA").

You can have multiple queries, and specify whether all conditions should be met ("AND" queries), or one of the conditions should be met ("OR") queries.

When you select the /Query command, the screen shows you any queries that have already been defined for the current report. The Query screen is divided into two parts. The upper part shows the queries in a English-like statement. The bottom part of the screen shows the equivalent programming statement for the currently highlighted query.

There are several actions you can perform that affect the currently highlighted query statement. (If there is no query defined, a blank line is highlighted.) These actions are:

Edit:	Edit the current (highlighted) query line.

Connect:	Allows you to change the connector between query lines.

Insert:	Inserts a new query line at the current cursor position.

Delete:	Deletes the current query line.

( ):	Allows you to control how expressions are evaluated. By enclosing portions of the expression within parenthesis, you can force those portions to be evaluated first. This works much like mathmatical expressions, such as 3 * (4 + 5).

Test	Will test the query expression for errors such as unmatched parenthesis or missing query line connectors.

Reset	Allows you to clear the existing query.

Quit	Returns to the main menu.

To create a new query, use the /Query command to display the Query screen. Then use the arrow keys to highlight a blank query line. The select the Edit command. The bottom portion of the screen will display a "Select Field" box, listing the available fields from the master database, along with choice for Database fields (to select fields from a related database), or Calculated fields (to select fields defined with the /Field, Calculate or /Field, Total menus). Use the arrow keys to highlight the desired field.

When you select a fields, the bottom portion of the screen displays the "Operations" available. The choices are:

Exactly Equal To: an exact match on all the characters or values that you enter. For instance, "Smith" is exactly equal to "Smith", but it is not exactly equal to "Smithsonian".

Equal To: a match on the characters or values that you enter. For instance, "Smith" is equal to "Smith" and "Smithsonian", since only the first five characters (the number of characters in "Smith") are matched.

Not Equal To: the values in the selected field to not match.

Greater Than: the selected field's value is greater than the query value.

Greater Than or Equal To: the value in the selected field is greater than or equal to the query value.

Less Than: the selected field's value is less than the query value

Less Than or Equal To: the value in the selected field is less than or equal to the query value.

Empty: the value of the selected field is empty or blank.

Not Empty: the value of the selected field is not empty, or contains any data

In the Range: the value of the selected field is in the range of query values. For instance, the range of query values could be 1 to 100, so values of 1 through 100 (inclusive) would meet this criteria.

Not In the Range: the value of the selected field is not in the list of query values.

In the List: the value of the selecteed field is in the list of query values. For instance, the query values list could contain "Smith", "Jones" and "Davis". Only those records in the database whose selected field matches names in the list would meet this criteria.

Not In the List: the value of the selected field is not in the list. For instance, a field containing "Thomas" is not in the list of "Smith", "Jones" and "Davis".

Use the arrow keys to select the operation you wish to use in your query.

When you have selected the Operation, the bottom part of the screen displays a "Select Field" box. This allows you to select the value you want to compare to the selected field, or to enter your own value. You can select fields from the master database, other Database Fields, or Calculated fields. The first entry is a blank line; when you select it, you can enter any character or numeric value.

For instance, if you want to build a query of all records in the current database whose lastname is between A and H, you would:

Select Field of LASTNAME

Operation of "Less Than or Equal To"

Select field of "H"

This will grab everyone from "Aadamson" to Hzierkle", since the match is only on one character of the last name. You could also use the "In the Range" operation, and enter "A" and "H" as the starting and ending range.

When you have more than one query line, you need to specify the "Connector" to determine how the queries are resolved. The Connectors are:

.AND. :	must meet hoth conditions

.OR.:	can meet either condition

.NOT.	combines with the .AND. and .NOT. conditions to reverse the condition. For example, ".AND..NOT. ." is the same as ".OR.".

If your queries are quite complex, you may want to use the "( )" command to put parenthesis around groups of statements. This lets you be more specific in your query conditions. For instance, your condition for a database of customers could be:

(CUSTOMER->LASTNAME is less than "H" .and. CUSTOMER->AMOUNTDUE is greater than or equal to $100.00) .or. CUSTOMER->LASTPAYMENT is less than 1/15/94.

This would result in the report printing a list of all customers whose:

Lastname is less than "H" (all "A" through "G") and who owe $100 or more, OR anyone who hasn't paid since 1/15/94.

The printout would show:

Amy Davis who owes $125

Harold Smith with a last payment of 12/1/93 would be included.

The report would not show:

Susan Davis who owes $75

Albert Thomas who last paid on 2/12/94

Bob Lewis who owes $200.

Queries can let you get a specific portion of the database on your reports. When you build a query, use the "Test" command to ensure that the query is built properly. The /Query, Reset command will clear all query statements. Use the /Query, Quit command to exit the Query screen.

Queries are saved with the report when you use the /Report, Save command. If you want to use a temporary query, load the report, change the query, run the report, then Exit the Report Painter without saving the report.

Print Menu (/Print)

The Print menu allows you to configure the report for various paper sizes, set margins, select the output destination, and set up the report for labels.

Configure

The Print, Configure menu is used to change the magins, settings, labels, and output options.

Page Margins

Page Length - Indicates the number of lines to use when creating report output. If this many lines is reached during page creation a page break will occur and the page will be sent to the report destination. The default value is 66.

Top Margin - Indicates the number of blank lines that appear at the start of each page. These lines will come before any report output lines including page header lines. The default value is 0.

Left Margin - Indicates the number of blank columns that precede each output line. The default value is 0.

Bottom Margin - Indicates the number of blank lines sent to the report destination at the end of each page, after any page footer lines. The default value is 0.

Right Margin - If the report destination is set to PRINTER the right margin will be the maximum number of characters output per line. All characters beyond this value will be truncated. If the report destination is either the DISPLAY or a FILE this value will be ignored.

Output Options

Report Copies -Indicates the number of complete copies of a report to produce. Any report sorting and querying is only done once, before the first copy is generated. If any errors occur during output creation printing will be terminated and no more copies generated. The default value is 1. Note: This setting is only valid when the report destination is PRINTER.

Start Output on Page - This setting is normally used when an error has occurred during report creation (such as a paper jam) and you want to restart the report where it left off. If this value is greater than 1 records will be processed normally except that no output for any pages less than this value will be created. Once this page has been reached, report output will continue normally. The default value is 1.

End Output on Page - This setting specifies the maximum number of output pages to create. The default value is 999,999.

Wait Between Pages - If set to YES you will be prompted to load a new piece of paper into the printer before each page is output. The default value is NO, do not prompt for paper load. Note: This setting is only valid when the report destination is PRINTER.

Eject Last Page - If set to YES and the report destination is PRINTER or FILE, a form-feed (page eject) will be added after the last page of report output. The default value is NO, do not eject last page.

Report Settings

Lines Per Inch - Indicates the number of lines per inch that will appear on the report output. This value must be either 6 or 8. The default value is 6. Note: This setting is ignored when the report destination is DISPLAY.

Pitch - Indicates the number of characters per inch that will appear on the report output. This must be 10, 12 or Compressed. The default value is 10. Note: This setting is ignored when the report destination is DISPLAY.

Page Orientation -This is used to specify the orientation of the output page. This must be either Portrait or Landscape. The default value is Portrait. Note: This setting is ignored when the report destination is DISPLAY.

Print Empty Body/Group Lines - If set to NO any group header, group footer, and body lines which are completely blank will be removed from the report output. This is different than removing lines which are empty. Empty lines have no fields on them and are always created. Blank lines are lines which have fields, but none of those fields produced any printable output. The default value is NO, do not print blank lines.

Suppress Body Lines - If set to TRUE body lines contained in a report will NOT be This can be used to quickly produce reports which contain only summary information. The default value is NO, print body lines.

Treat Semicolon as New Line - This setting affects the word wrapping of fields which are formatted as word-wrapped or mail-merge. If set to YES any semicolons contained in the text will be translated to a new line before wrapping occurs. The default value is NO, do not translate semicolons.

Break Body Area - If set to YES a check will be made to see if the current set of body lines will fit entirely on the current page. If they won't fit a page break will be issued before outputting the body lines. The default value is NO, do not check to see if the lines will fit.

Label Options

Labels Across - This setting is used to determine that a label report is being created. When this value is greater than 1, the values found in Label Width and Label Height will be enforced.

Label Width - How wide a label is. Each label will appear exactly Label Width columns to the right of the previous label. If set to 0 each label will be the width of the entire report.

Label Height - How high a label is. Each label will appear exactly Label Height lines below the label above it. If set to 0 each label will occupy the same number of Body Lines found in the report.

Record Copies - How many copies of each label should be created.

Destination

This menu choice allows you to choose where report output should be sent. You can select the display, a file, or one of the many printers supported by the report writer.

Display - Send report output to the screen.

Printer - Allows you specify the printer to use when producing output. If you select this option a list of available printers will be displayed. After you have selected the printer, you will be prompted to select the port to send output to. If you are unsure, select 'PRN'.

File - Allows you specify the report output should be sent to a file name. If you select this option you will be prompted to enter the name of the file to send output to. A list of available printers will be then be displayed so the output file can contain appropriate printer codes if they are needed.

Run

This starts the report creation processes. Report output will be sent to the specified destination.

Report Menu (/Report)

Load - Load a report from a disk file. You will be prompted to enter the name of the file to load. Pressing [F2] will allow you to browse the files and directories on your hard drive. If you wish to quickly move to a specific directory, you may enter the directory name and press [F2].

Save - Save the current report to a disk file. If the report had previously been loaded from or saved to disk, the name attached to the report will be displayed. If the report has no name you will be prompted to enter one.

Create - Create a new report. If a report is currently loaded you will be asked if you wish to lose the current report an load a new one. If you select 'Yes' you will be prompted to select a master database for the new report. Choose the file you want and press [ENTER]. You will then be prompted to enter the alias to use when opening the file. You can press [ENTER] to accept the default value or type a new value to use.

Sort-Group Menu (/Sort)

Sort - Allows you to change the order in which report output will be sorted. After selecting this option, a picklist of available fields will appear. Select the field you want to sort on and press [ENTER]. You will then prompted to specify the order in which this field should be sorted. You may select 'Ascending' or 'Descending'.

Group - Allows you to specify at what points the report should be grouped. After selecting this option, a picklist of available fields will appear. Select the field you want to group on and press [ENTER]. You will then prompted to enter a description of the grouping. This description will be used to represent group header and footer lines of the level in the painter and in picklists.

Duplicate - Duplicates all Sort entries to Group entries.

Revert -Clears any changes made to Sorts and Groups, restoring their original values.

Clear - Will clear all Sort and Group entries.

Options Menu (/Options)

Directories

Report - The directory to look at for report files.

Database - The directory to look at for database files.

Index -The directory to look at for index files.

Swap - The directory to look at for temporary files.

Move-Size

Allows you to move and/or resize the report window. The keyboard shortcut for this is [ALT-Y].

Zoom

Allows you to zoom in/out the report window. The keyboard shortcut for this is [ALT-Z].

Remove - Will remove all lines from a report allowing you to start fresh.

Squeeze - Will remove all unused fields from the report.

Jump-Start - Allows you to toggle whether the cursor should jump to the start/end of a field or not. The keyboard short cut for this is [SHIFT-F12].

Printer-Table - Allows you to specify the database to use for printer codes.

Creating Labels

Label reports are defined by setting Labels Across (in the /Print, Configure sub-menu) to a value greater than 1. When printing label reports, the processing of body lines is handled differently than in normal reports. Instead of generating one set of body lines per composite record, one set of body lines will be created for the number of labels defined in Labels Across.

When creating label reports the values found in Label Height and Label Width are enforced. These can be used to ensure that each label printed on a page is exactly the same size and distance from other labels on the same page.

If Label Height is 0, each label will occupy the same number of rows as the number of body lines contained in the report. If it is greater than 0 the number defined will be used regardless of the actual number of body lines in the report. Any word-wrapped fields appearing on body lines will only wrap to the end of the label. All other text will be -truncated.

Each label will appear Label Width columns to the right of the previous label until the specified number of labels has been processed. For example, if you were to set Labels Across to 2, Label Width to 30 and Label Height to 4 your report output might look like:

Ratty Software Corp.	MOMAs Pizza

1313 Mockingbird Lane.	Museum of Modern Art

Milwalkee, NJ 10321-1222	5th Ave

New York, NY 13123

OK Gifts Inc.	Clipper Life Rafts Inc.

1 RU Lost	666 Sinking Fox Lane

In, NJ 12333-1211	No Clue, UH 99999-9999

Notice how the entry for MOMAs Pizza ends on the line right before the entry for Clipper Life Rafts? This is because Label Height is 4 and the entry for MOMAs took all 4 lines.

To print multiple copies of the same composite record use the Record Copies option. For example, using the above label definitions if you also set Record Copies to 2 your output might look like:

Ratty Software Corp.	Ratty Software Corp.

1313 Mockingbird Lane.	1313 Mockingbird Lane.

Milwalkee, NJ 10321-1222	Milwalkee, NJ 10321-1222

MOMAs Pizza	MOMAs Pizza

Museum of Modern Art	Museum of Modern Art

5th Ave	5th Ave

New York, NY 13123	New York, NY 13123

OK Gifts Inc.	OK Gifts Inc.

1 RU Lost	1 RU Lost

In, NJ 12333-1211	In, NJ 12333-1211

Clipper Life Rafts Inc.	Clipper Life Rafts Inc.

666 Sinking Fox Lane	666 Sinking Fox Lane

No Clue, UH 99999-9999	No Clue, UH 99999-9999

NOTE: If you are creating label reports you cannot view multiple records across when the destination is set to the Display. Only one column of labels are shown on the display. When the output is sent to the printer or file, the labels will be formatted properly.

Basic Painter Keyboard Shortcuts

[F2]	- Edit current field.
[F7]	- Add field at current cursor position.
[ENTER]	- Start/Stop the moving of a field.
[UP]	- Move cursor/field up one row.
[DOWN]	- Move cursor/field down one row.
[LEFT]	- Move cursor/field left one column.
[RIGHT]	- Move cursor/field right one column.
[PGUP]	- Move cursor/field up one full screen.
[PGDN]	- Move cursor/field down one full screen.
[HOME]	- Move cursor/field to the first column.
[END]	- Move cursor/field to the end of the line.
[INS]	- Move fields past the current column one column right.
[DEL]	- Move fields past the current column one column left.
[TAB]	- Move cursor to next field.
[SHIFT-TAB]	- Move cursor to previous field.
[CTRL-RIGHT]	- Move cursor/field five columns to the right.
[CTRL-LEFT]	- Move cursor/field five columns to the left.
[CTRL-PGUP]	- Move cursor/field to the first report row.
[CTRL-PGDN]	- Move cursor/field to the last report row.
[ALT-A]	- Add line of the same type and level as the current line.
[ALT-F]	- Change format of a field.
[ALT-I]	- Move/resize the line type display area.
[ALT-L]	- Load a report from disk.
[ALT-M]	- Move line within others of the same type and level.
[ALT-O]	- Toggle line format display on/off.
[ALT-R]	- Remove current line from report.
[ALT-S]	- Save the current report to disk.
[ALT-T]	- Change printer attribute of a field.
[ALT-U]	- Remove field from line.
[ALT-Y]	- Move/resize the report window.
[ALT-Z]	- Zoom report window in/out.
[SHIFT-F12]	- Toggle cursor jumpstart on/off.
[CTRL-K]	- Toggle line autotrim flag on/off.