home *** CD-ROM | disk | FTP | other *** search
- Printing Reports
- ================
-
- 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 tag 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. }{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{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.
-
- Record numbers
- ==============
- It is sometimes useful to have a list of the numbers of records. If you
- toggle the ‘Match’ window to full size you will find an option button to
- ‘Include record numbers’. These will appear in an extra column at the left
- hand side of the report.
-
- 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 with the
- identifier (i.e. tag or descriptor) at the left
- hand side. The total width of the text (including
- the identifiers) is determined by the value in
- ‘Text width’. If the field will not fit onto a
- single line it is word-wrapped (as on a word-
- processor) and formatted so that the identifier
- “hangs” in the left margin.
-
- 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.
-
- (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
- =======================================================
-
- Column headings
- ———————-
- The headings which appear in all except ‘Label’ format are either the field
- tags or field descriptors depending on the settings of a pair of radio
- buttons in the ‘Print options’ window.
-
- Print pitch
- —————-
- Four radio buttons control the number of characters per inch printed on most
- printers.
-
- Expand codes
- ——————
- Causes extra data from a validation table to be substituted for (or added
- to) the coded data in fields linked to such tables. See ‘Validation’ for
- further details.
-
- Underline
- ————-
- This switch causes underlining of all output when hard copy is produced, but
- not when it appears on the screen. If you print using the ‘Table’ format
- with output sent to a window you will see the vertical lines defining the
- blank columns, but not the underlining which divides the table into cells.
- If, however, you drag the file to the printer the horizontal lines duly
- appear.
-
- Upper case
- —————
- Causes all textual output to appear in capital letters only.
-
- Date stamp
- —————
- Causes the date and time at which the report was created to appear as part
- of the header information.
-
- Header page 1 only
- —————————
- Header information not only means column headings in ‘Horizontal’ and
- ‘Table’ format as described above but also the following:-
-
- * A title derived from the search formula used to create the report.
- * An optional additional title entered in the ‘Print options’ window.
- * The data and time stamp (if selected).
-
- Normally this information appears at the head of every new page of the
- report. Setting the above-named switch restricts the header information to
- the beginning of the report and inserts no page breaks within the remainder.
- The purpose of this is to allow sensible use of the ‘Sort’ option which is
- available when a report is sent to a window.
-
- Shrink list
- —————-
- In ‘Horizontal’ and ‘Table’ format the width of the columns is determined by
- the maximum defined length of the fields included in the print selection.
- These lengths are often rather generous compared to the length of data
- actually present in the fields, resulting in a lot of “white space” between
- the columns. Setting the ‘Shrink list’ switch BEFORE generating a report
- causes Powerbase to make two passes through the data. The first determines
- what the ACTUAL, as opposed to the ALLOWED, maximum field lengths are. The
- second creates the report using these maxima, thus closing up the space
- between columns in most cases.
-
- Page length
- —————-
- Total length of page, including header, footer and top margin. For an A4
- page this is 70 lines (the default). Standard fan-fold computer paper such
- as is usually used in dot-matrix printers is more likely to be of the page
- size known in the U.S.A. as “letter”. This requires a page length setting of
- 66 lines. In ‘Vertical’ format Powerbase will try to avoid splitting a
- record between pages, but this can happen when the report includes
- ‘External’ text fields (‘Text’ or ‘Text Block’) of greatly varying length.
- It will also happen, of course, if the number of fields to be printed
- exceeds the length of the page!
-
- Line spacing
- ——————
- A setting of 1 (default) leaves no blank lines between the lines of print-
- out. 2 results in “double spaced” output. Higher values may be used but are
- seldom useful.
-
- Title
- ——-
- The normal header information includes a title which Powerbase constructs
- from the search formula used to produce the report. This is often quite
- sufficient but you may supplement it with a title of your own typed into the
- writable icon provided for this purpose.
-
- Top and left margins
- ——————————
- These may be used to adjust the position of the report on the page so that a
- short, narrow list may be positioned somewhere near the centre. The top
- margin is specified in lines and the left margin in character widths.
-
- Text width
- —————
- This specifies the line length used when printing in ‘Vertical’ format.
-
- Column spacer
- ——————-
- The character string in this box is used to specify how the columns are
- separated when printing in ‘Horizontal’ or ‘Table’ format. Columns are first
- padded with spaces to the maximum width of the relevant data field (but see
- ‘Shrink list’ above) and the spacer string is then printed before starting
- the next column. The ‘Column spacer’ box contains 1 by default, meaning
- that the default spacer is a single space. A maximum of 5 characters is
- allowed. Three interpretations of the contents of this box are possible:-
-
- (1) A number by itself means use the specified number of spaces.
- (2) A number followed by a non-numeric character means use a string of
- the specified number of that character, e.g. 3- means 3 hyphens.
- (3) A non-numeric string is used “as is”, e.g. “|” or “ | ”.
-
- Printing single records
- =======================
- The ‘Match’ window contains a large button marked ‘Print this’. When clicked
- this causes only the displayed record to be printed. The field selection and
- format are chosen in exactly the same way as for a more extensive report.
-
- A second way of printing the displayed record is to press the ‘Print’ key on
- the keyboard. For this to work you must have first saved a field selection
- file called ‘Default’ in the ‘PrintRes’ subdirectory of the database. If
- this file is not found an error message is displayed, otherwise the current
- record is printed in ‘Vertical’ format.
-
- The ‘Print’ key has two other actions which can be useful short-cuts. Used
- in conjunction with SHIFT it opens up the ‘Match’ window. With CTRL it opens
- the ‘Print options’ window.
-
-
-