This document describes how to print out selected data from a Powerbase
application, including the printing of individual records and of labels.
Output destination
==================
Bring up the main menu, go to the 'Print' submenu and choose the 'Options'
entry to display the 'Print options' dialogue box. This is a large window
containing many icons and might appear rather daunting at first. Efforts
have been made to render it easier to use by dividing it up into several
areas each dedicated to a specific aspect of printing.
In the bottom right corner is the area which determines the destination for
printed output. Three options are available: 'Window', 'File' and 'Printer',
each of which is described below.
The 'Window' destination
========================
This option (which is set by default) results in all output being displayed
in its own window which opens on top of the record window when the report is
complete. Clicking MENU over this window displays the 'List' menu which
offers the following choices:-
Save as text
------------
This leads to a 'Save' box from which you can save the report as a text
file. The default pathname uses the leaf-name "List" for the file and points
to a subdirectory called 'PrintJobs' which is inside the database directory.
Each database thus has its own 'PrintJobs' directory. Its contents can be
displayed by selecting 'Show jobs done' from the 'Print' submenu. To save
files with the least bother, therefore, either accept the whole default
path-name or delete up to (but not including) the rightmost full-stop and
type a new leaf-name then click on 'OK' or type RETURN. Make a habit of
looking in 'PrintJobs' regularly to check up on what's there and to get rid
of files which you no longer need. As an alternative you can, of course,
drag the icon from the 'Save' box to any filer viewer you choose, to the
printer icon, or directly into any application (such as Edit) which can
accept a text file.
Sort
----
The 'Sort' entry allows the report to be sorted alphabetically, but will be
shaded unless you select the 'Header p.1 only' option in the 'Print options'
window.
Scrap
-----
A large report can occupy a lot of memory which you may need to recover (in
order to load another application without quitting Powerbase, for example).
If you follow the big report with a small one the unused memory will be
given back, but this is much more tidily accomplished by choosing 'Scrap'
from the 'List' menu.
Accessing records from a displayed report
=========================================
The report window has another interesting and useful feature. If you point
at a particular piece of displayed data and double click with SELECT the
record will be displayed in the record window with the caret placed in the
field on which you clicked. If you are using a report to look for errors in
the data any which you find can be quickly corrected using this method. (The
report won't reflect the corrections which you make, though, unless you
re-create it.)
The 'File' destination
======================
If you select 'File' instead of 'Window' then the Save' box will pop up as
soon as you tell Powerbase to go ahead and generate the report. The report
is created when you click on the 'Save' box's 'OK' button or drag the icon
into a directory viewer. The default pathname calls the file "List" and
points to 'PrintJobs' as described above.
The 'Printer' destination
=========================
This generates the file in memory then sends the data directly to the
printer. No copy of the file is saved. If you use this option make sure that
!Printers is installed on the icon-bar and that the printer is ready before
you give the command to create the report.
What types of field can Powerbase print?
========================================
The procedure to be described enables you to print data from the following
types of field:-
(1) Any field into which you can directly type data.
(2) 'Text' and 'Text Block' fields.
(3) Check Boxes. What is actually printed differs from what you see
in the check box. Thus:-
(a) "Tick/Cross"-type boxes result in "Yes" or "No".
(b) "Tick/Blank"-type boxes result in "Yes" or nothing.
(c) "Star/Blank"-type boxes result in an asterisk or nothing.
'Draw' and 'Sprite' fields can be printed by clicking on the relevant button
in the record window to load the external file into "Draw" or "Paint" then
printing from that application in the normal way. You may, of course, do the
same with 'Text' fields. 'Picture' fields must be exported to "Paint" via
the 'Field' submenu's 'Save contents' entry.
How do I specify what to print?
===============================
There are two stages to this:-
(1) Specifying which FIELDS from the record to print.
(2) Specifying which RECORDS to print.
Specifying a field selection
----------------------------
Highlight the fields which you want to appear on the report by clicking on
them with ADJUST. If you change your mind you can deselect fields by
clicking a second time with ADJUST. Note that the order in which you select
the fields is important since that's the order in which they will appear in
the report. There is no visible indication on the record screen of what the
order is so take care when making your field selection. The only fields
which can be highlighted in this way are those which can actually be printed
(see above).
Several entries on the 'Print' submenu deal with field selections. 'Save
selection' lets you preserve the current selection for re-use. The default
pathname in the 'Save' box points to a directory called 'PrintRes' (i.e
"Print resources") which (like 'PrintJobs' - see above) resides inside the
database application directory. 'Show resources' on the 'Print' submenu will
display the contents of this directory. Selection files are of type &7f3 and
are distinguished by an icon bearing an "S". They may be reloaded by
dragging from the 'PrintRes' viewer and dropping on the record window or by
simply double-clicking on them. Other entries in the 'Print' submenu enable
you to select all the fields in the record or to clear the selection
completely.
Specifying which records to print
---------------------------------
The first item on the 'Print' submenu is 'Match'. Clicking on this (or, even
simpler, clicking on 'Print' in the main menu) opens the 'Match' window in
which you specify the criteria which must be met by records for inclusion in
the list. Clicking OK (or typing RETURN) without entering anything produces
a list of the whole database (or, more accurately, of the the whole of the
current subfile). Exactly how the list is delivered depends on the setting
of the destination buttons in the 'Print options' window (see "Output
destination" above). If the mouse pointer is over the record window or
'Match' window the hourglass will tell you how far things have progressed.
Pressing Escape causes the process to be aborted.
Most database queries will be more selective than this; in other words there
will be a target group of records which are specified by entering a SEARCH
FORMULA before clicking OK. A search formula describes the criteria which
records must match in order to be included in the report. Getting to grips
with search formulae is, perhaps, the biggest hurdle faced by the new
Powerbase user and you are referred first to the simple examples described
in the 'Tutorial' file.
A SEARCH FORMULA consists of one or more SEARCH ELEMENTS. A search element
specifies that a field value must fit a certain condition and takes the
form:
<TAG LIST><COMPARATOR><TARGET LIST>
The angle brackets are there for clarity and are not used in entering the
actual formula and there must be no spaces between the three parts. A tag
list has the form:-
tag1,tag2,tag3,....
where tag1 etc. are the field tags which identify the fields to be matched.
A target list has the form:-
target1,target2,target3,....
All comparison are case specific unless you deselect the button on the Match
window which controls this. It is impossible to describe the use of search
formulae adequately without quoting actual examples. As in the 'Tutorial'
file we will again make use of the 'Elements' sample database supplied with
Powerbase.
An example of a search criterion is GP=T where:-
GP is the field tag
= is the comparator
T is the target.
In plain English this means "The field whose tage is 'GP' must contain the
value 'T'", i.e. all transition elements (but no others) are to be included
in the report. A slightly more complex one is GP=1,2,3 which would be
interpreted as "The 'GP' field matches one of '1','2' or '3'". This may also
be entered as GP=1 OR GP=2 OR GP=3, which is possibly easier to understand
but also somewhat longer.
A further example is OX1,OX2,OX3=3, meaning "One of the first three oxidation
state fields has the value 3." This could, of course, be entered as
OX1=3 OR OX2=3 OR OX3=3. Yet another way of entering this is OX1-OX3=3,
i.e. you may specify a range of ADJACENT fields by giving the first and last
separated by a hyphen.
Note that in the above examples the search is EXCLUSIVE, i.e. ONE OF the
fields in the tag list matches ONE OF the targets in the target list.
Sometimes we want an INCLUSIVE search so that ALL OF the fields in the tag
list match a given target or, less frequently, a field contains ALL OF the
values in the target list. To convert an exclusive to an inclusive search
you need to DOUBLE THE COMPARATOR, in other words use == instead of =.
The comparators available, which may be seen by clicking the Match window to
full size, are =, <>, <, >, <=, >=, { and }{. { is to be read as "contains"
and is used where the target value is expected to be part of the field but
not to take up the whole field. }{ means "does not contain".
You may invert the logic of a search criterion by putting NOT in front of it.
To print all non-transition elements you would use NOT GP=T. Note the space
after NOT, and that the syntax isn't "GP NOT=T". You could equally well use
GP<>T and may find this form more understandable.
Multi-criterion searches may be implemented either by placing tags and
targets in comma-separated lists as described above or by stringing search
criteria together with the connectives AND and OR. Use AND when a field must
meet ALL of a set of criteria. e.g. GP=T AND Z>50 AND NAME{IUM would find
all transition metals with atomic numbers greater than 50 whose names
contain "IUM".
Use OR when a field must meet ONE of a set of criteria. e.g GP=L OR GP=A
would find all lanthanide and actinide elements since the formula says, in
effect, "either L or A; I don't care which".
Using AND and OR can lead to search formulae which are ambiguous. e.g. does
GP=1 OR GP=2 AND Z<50 mean "group 1 or 2 elements (don't care which) with
atomic numbers less than 50" or does it mean "group one elements (of any
atomic number) or group 2 elements whose atomic numbers are less than 50"?
You probably want the former, but Powerbase will give you the latter. To get
what you require USE BRACKETS to make the logic clear. In other words write
it: (GP=1 OR GP=2) AND Z<50.
Queries are, by default, case-sensitive. If you don't want case to be
disregarded deselect the 'Case specific' button on the 'Match' window.
If a Numeric field appears in a search formula then the comparison with the target is made by NUMERIC VALUE, e.g. "NUM=5" would match "5", "05", "5.0" etc. For other types of field the comparison is by CHARACTER MATCHING. This can easily catch you out. Suppose for example you want to print records for which "NUM<8". You might be surprised to find records in which NUM contains values such as 55, 20, or 13 being printed, as well as those containing 4, 6, 2 etc! If this happens, check that the field is defined as numeric.
You can FORCE a comparison-by-value for a non-numeric field by enclosing the field tag in square brackets, e.g. [NUM]<8 would produce the desired result in the above example. This is useful where you want to make such a comparison but still allow the field to accept non-numeric characters. The comparison-by-value can only work in such cases, however, if the number part of the field comes first. e.g. it will deal correctly with 55A, 20B, 13X but not with A55, B20, X13.
Print format
============
The 'Format' section of the 'Print options' window provides four choices:-
Horizontal Records are displayed one to a line, the fields
being aligned in columns with headings.
Table This resembles the 'Horizontal' format but each
record is underlined and a user-definable number of
ruled columns (6 by default) is placed to the right
of the text, thus producing a grid. You are advised
to set the print pitch to 10 or 12 when using this
format. The width of the blank columns is determined
by the value in 'Column width'.
Vertical Fields are printed underneath each other, one field
to a line, each record being separated from the next
by a dotted line. Field identifiers appear at the
left hand side.
Label For printing on special label stationery. A special
window lets you set the label size, the number of
labels in a row (1-3) and the number of lines on a
label. Each field normally appears on a separate line, but holding down SHIFT while selecting a field with ADJUST causes the selected field to print on the same line as the previous field.
Notes
-----
(1) If the print selection contains a 'Text' or 'Text block' field then only
'Vertical' format may be used and this will be selected automatically. The
line length used to print such fields is given by the 'Text width' value in
the 'Print options' window.
(2) In 'Label' format you may include in the print selection one field more
than the number of lines to be printed on each label. A switch in the
'Label' window will, if set, cause this extra field to be substituted for
another if the latter is blank. You may specify which field is replaced in
this way. Another switch causes the primary key of the record to appear on
each label as a means of identification, which can be useful if the data
printed on the label doesn't make it obvious which record it comes from.
Field analysis reports
======================
The 'Field' submenu has an 'Analyse' option which allows you to print a breakdown of the field contents under certain special circumstances:
(a) If the field is INDEXED. The menu entry will read 'Analyse index'. When chosen it will produce a list of all the values in the index along with the number of times each one occurs. e.g. A database of college students might have a field for the school of origin. If there are 20 different schools and if the field is indexed then a list of those schools will be generated showing how many students came from each school.
(b) If the field contains either an 8 or 10 character date (e.g. 19-10-42 or
19-10-1942) then the menu entry reads 'Analyse months' and a breakdown by month will be printed. There will be a line for each of the 12 months showing the number of records for each month. This could, for example, be used in an orders database to find out quickly how many orders were received or dispatched in each month. This feature will work on editable 'Date' fields and also on 'Date stamp8' and 'Date stamp10' fields in the 'Stamp' class.
It is, of course, possible for a field containing a date to be indexed. Action (a) (above) takes precedence in such a case. You can, however, force action (b) instead by first selecting the field with ADJUST, then choosing from the menu.
For cases not described above the menu entry simply says 'Analyse' and is shaded. Printing is always to a window (from which the report may, of course, be saved): the 'Destination' buttons in the 'Print options' window have no effect.
Other features controlled by the 'Print options' window