home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / utilities / powerbase / pbasedoc / printing < prev    next >
Encoding:
Text File  |  1994-01-24  |  21.9 KB  |  421 lines

  1.                                 Printing Reports
  2.                                 ================
  3.  
  4. This document describes how to print out selected data from a Powerbase
  5. application, including the printing of individual records and of labels.
  6.  
  7. Output destination
  8. ==================
  9. Bring up the main menu, go to the 'Print' submenu and choose the 'Options'
  10. entry to display the 'Print options' dialogue box. This is a large window 
  11. containing many icons and might appear rather daunting at first. Efforts
  12. have been made to render it easier to use by dividing it up into several
  13. areas each dedicated to a specific aspect of printing.
  14.  
  15. In the bottom right corner is the area which determines the destination for
  16. printed output. Three options are available: 'Window', 'File' and 'Printer',
  17. each of which is described below.
  18.  
  19. The 'Window' destination
  20. ========================
  21. This option (which is set by default) results in all output being displayed
  22. in its own window which opens on top of the record window when the report is
  23. complete. Clicking MENU over this window displays the 'List' menu which
  24. offers the following choices:-
  25.  
  26. Save as text
  27. ------------
  28. This leads to a 'Save' box from which you can save the report as a text
  29. file. The default pathname uses the leaf-name "List" for the file and points
  30. to a subdirectory called 'PrintJobs' which is inside the database directory.
  31. Each database thus has its own 'PrintJobs' directory. Its contents can be
  32. displayed by selecting 'Show jobs done' from the 'Print' submenu. To save
  33. files with the least bother, therefore, either accept the whole default
  34. path-name or delete up to (but not including) the rightmost full-stop and
  35. type a new leaf-name then click on 'OK' or type RETURN. Make a habit of
  36. looking in 'PrintJobs' regularly to check up on what's there and to get rid
  37. of files which you no longer need.  As an alternative you can, of course,
  38. drag the icon from the 'Save' box to any filer viewer you choose, to the
  39. printer icon, or directly into any application (such as Edit) which can
  40. accept a text file.
  41.  
  42. Sort
  43. ----
  44. The 'Sort' entry allows the report to be sorted alphabetically, but will be
  45. shaded unless you select the 'Header p.1 only' option in the 'Print options'
  46. window. 
  47.  
  48. Scrap
  49. -----
  50. A large report can occupy a lot of memory which you may need to recover (in
  51. order to load another application without quitting Powerbase, for example).
  52. If you follow the big report with a small one the unused memory will be
  53. given back, but this is much more tidily accomplished by choosing 'Scrap'
  54. from the 'List' menu.
  55.  
  56. Accessing records from a displayed report
  57. =========================================
  58. The report window has another interesting and useful feature. If you point
  59. at a particular piece of displayed data and double click with SELECT the
  60. record will be displayed in the record window with the caret placed in the
  61. field on which you clicked. If you are using a report to look for errors in
  62. the data any which you find can be quickly corrected using this method. (The
  63. report won't reflect the corrections which you make, though, unless you
  64. re-create it.)
  65.  
  66. The 'File' destination
  67. ======================
  68. If you select 'File' instead of 'Window' then the Save' box will pop up as
  69. soon as you tell Powerbase to go ahead and generate the report. The report
  70. is created when you click on the 'Save' box's 'OK' button or drag the icon
  71. into a directory viewer. The default pathname calls the file "List" and
  72. points to 'PrintJobs' as described above.
  73.  
  74. The 'Printer' destination 
  75. =========================
  76. This generates the file in memory then sends the data directly to the
  77. printer. No copy of the file is saved. If you use this option make sure that
  78. !Printers is installed on the icon-bar and that the printer is ready before
  79. you give the command to create the report. 
  80.  
  81. What types of field can Powerbase print?
  82. ======================================== 
  83. The procedure to be described enables you to print data from the following
  84. types of field:-
  85.  
  86.         (1) Any field into which you can directly type data.
  87.         (2) 'Text' and 'Text Block' fields.
  88.         (3) Check Boxes. What is actually printed differs from what you see
  89.             in the check box. Thus:-
  90.  
  91.             (a) "Tick/Cross"-type boxes result in "Yes" or "No".
  92.             (b) "Tick/Blank"-type boxes result in "Yes" or nothing.
  93.             (c) "Star/Blank"-type boxes result in an asterisk or nothing.
  94.  
  95. 'Draw' and 'Sprite' fields can be printed by clicking on the relevant button
  96. in the record window to load the external file into "Draw" or "Paint" then
  97. printing from that application in the normal way. You may, of course, do the
  98. same with 'Text' fields. 'Picture' fields must be exported to "Paint" via
  99. the 'Field' submenu's 'Save contents' entry.
  100.  
  101. How do I specify what to print?
  102. ===============================
  103. There are two stages to this:-
  104.  
  105.         (1) Specifying which FIELDS from the record to print.
  106.         (2) Specifying which RECORDS to print.
  107.  
  108. Specifying a field selection
  109. ----------------------------
  110. Highlight the fields which you want to appear on the report by clicking on
  111. them with ADJUST. If you change your mind you can deselect fields by
  112. clicking a second time with ADJUST. Note that the order in which you select
  113. the fields is important since that's the order in which they will appear in
  114. the report. There is no visible indication on the record screen of what the
  115. order is so take care when making your field selection. The only fields
  116. which can be highlighted in this way are those which can actually be printed
  117. (see above).
  118.  
  119. Several entries on the 'Print' submenu deal with field selections. 'Save
  120. selection' lets you preserve the current selection for re-use. The default
  121. pathname in the 'Save' box points to a directory called 'PrintRes' (i.e
  122. "Print resources") which (like 'PrintJobs' - see above) resides inside the
  123. database application directory. 'Show resources' on the 'Print' submenu will
  124. display the contents of this directory. Selection files are of type &7f3 and
  125. are distinguished by an icon bearing an "S". They may be reloaded by
  126. dragging from the 'PrintRes' viewer and dropping on the record window or by
  127. simply double-clicking on them. Other entries in the 'Print' submenu enable
  128. you to select all the fields in the record or to clear the selection
  129. completely.
  130.  
  131. Specifying which records to print
  132. ---------------------------------
  133. The first item on the 'Print' submenu is 'Match'. Clicking on this (or, even
  134. simpler, clicking on 'Print' in the main menu) opens the 'Match' window in
  135. which you specify the criteria which must be met by records for inclusion in
  136. the list. Clicking OK (or typing RETURN) without entering anything produces
  137. a list of the whole database (or, more accurately, of the the whole of the
  138. current subfile). Exactly how the list is delivered depends on the setting
  139. of the destination buttons in the 'Print options' window (see "Output
  140. destination" above). If the mouse pointer is over the record window or
  141. 'Match' window the hourglass will tell you how far things have progressed.
  142. Pressing Escape causes the process to be aborted. 
  143.  
  144. Most database queries will be more selective than this; in other words there
  145. will be a target group of records which are specified by entering a SEARCH
  146. FORMULA before clicking OK. A search formula describes the criteria which
  147. records must match in order to be included in the report. Getting to grips
  148. with search formulae is, perhaps, the biggest hurdle faced by the new
  149. Powerbase user and you are referred first to the simple examples described
  150. in the 'Tutorial' file.            
  151.                     
  152. A SEARCH FORMULA consists of one or more SEARCH ELEMENTS. A search element
  153. specifies that a field value must fit a certain condition and takes the
  154. form:
  155.                      <TAG LIST><COMPARATOR><TARGET LIST>
  156.  
  157. The angle brackets are there for clarity and are not used in entering the
  158. actual formula and there must be no spaces between the three parts. A tag
  159. list has the form:-
  160.                               tag1,tag2,tag3,.... 
  161.  
  162. where tag1 etc. are the field tags which identify the fields to be matched.
  163.  
  164. A target list has the form:- 
  165.                               target1,target2,target3,....
  166.  
  167. All comparison are case specific unless you deselect the button on the Match
  168. window which controls this. It is impossible to describe the use of search
  169. formulae adequately without quoting actual examples. As in the 'Tutorial'
  170. file we will again make use of the 'Elements' sample database supplied with
  171. Powerbase.
  172.  
  173. An example of a search criterion is GP=T where:-
  174.  
  175.                          GP is the field tag
  176.                           = is the comparator
  177.                           T is the target.
  178.  
  179. In plain English this means "The field whose tage is 'GP' must contain the
  180. value 'T'", i.e. all transition elements (but no others) are to be included
  181. in the report. A slightly more complex one is GP=1,2,3 which would be
  182. interpreted as "The 'GP' field matches one of '1','2' or '3'". This may also
  183. be entered as GP=1 OR GP=2 OR GP=3, which is possibly easier to understand
  184. but also somewhat longer.
  185.  
  186. A further example is OX1,OX2,OX3=3, meaning "One of the first three oxidation
  187. state fields has the value 3."  This could, of course, be entered as
  188. OX1=3 OR OX2=3 OR OX3=3.  Yet another way of entering this is OX1-OX3=3,
  189. i.e. you may specify a range of ADJACENT fields by giving the first and last
  190. separated by a hyphen. 
  191.  
  192. Note that in the above examples the search is EXCLUSIVE, i.e. ONE OF the
  193. fields in the tag list matches ONE OF the targets in the target list. 
  194. Sometimes we want an INCLUSIVE search so that ALL OF the fields in the tag 
  195. list match a given target or, less frequently, a field contains ALL OF the
  196. values in the target list.  To convert an exclusive to an inclusive search
  197. you need to DOUBLE THE COMPARATOR, in other words use == instead of =.
  198.  
  199. The comparators available, which may be seen by clicking the Match window to
  200. full size, are =, <>, <, >, <=, >=, { and }{. { is to be read as "contains"
  201. and is used where the target value is expected to be part of the field but
  202. not to take up the whole field. }{ means "does not contain".
  203.  
  204. You may invert the logic of a search criterion by putting NOT in front of it.
  205. To print all non-transition elements you would use NOT GP=T. Note the space
  206. after NOT, and that the syntax isn't "GP NOT=T".  You could equally well use
  207. GP<>T and may find this form more understandable.
  208.  
  209. Multi-criterion searches may be implemented either by placing tags and
  210. targets in comma-separated lists as described above or by stringing search
  211. criteria together with the connectives AND and OR. Use AND when a field must
  212. meet ALL of a set of criteria. e.g. GP=T AND Z>50 AND NAME{IUM would find
  213. all transition metals with atomic numbers greater than 50 whose names
  214. contain "IUM".
  215.  
  216. Use OR when a field must meet ONE of a set of criteria. e.g GP=L OR GP=A
  217. would find all lanthanide and actinide elements since the formula says, in
  218. effect, "either L or A; I don't care which".
  219.  
  220. Using AND and OR can lead to search formulae which are ambiguous. e.g. does
  221. GP=1 OR GP=2 AND Z<50 mean "group 1 or 2 elements (don't care which) with
  222. atomic numbers less than 50" or does it mean "group one elements (of any
  223. atomic number) or group 2 elements whose atomic numbers are less than 50"?
  224. You probably want the former, but Powerbase will give you the latter. To get
  225. what you require USE BRACKETS to make the logic clear. In other words write
  226. it: (GP=1 OR GP=2) AND Z<50.
  227.  
  228. Queries are, by default, case-sensitive. If you don't want case to be
  229. disregarded deselect the 'Case specific' button on the 'Match' window.
  230.  
  231. 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.
  232.  
  233. 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.
  234.  
  235. Print format
  236. ============
  237. The 'Format' section of the 'Print options' window provides four choices:-
  238.  
  239.         Horizontal      Records are displayed one to a line, the fields
  240.                         being aligned in columns with headings. 
  241.  
  242.         Table           This resembles the 'Horizontal' format but each
  243.                         record is underlined and a user-definable number of
  244.                         ruled columns (6 by default) is placed to the right
  245.                         of the text, thus producing a grid. You are advised
  246.                         to set the print pitch to 10 or 12 when using this
  247.                         format. The width of the blank columns is determined
  248.                         by the value in 'Column width'.
  249.  
  250.         Vertical        Fields are printed underneath each other, one field
  251.                         to a line, each record being separated from the next
  252.                         by a dotted line. Field identifiers appear at the
  253.                         left hand side.
  254.  
  255.         Label           For printing on special label stationery. A special
  256.                         window lets you set the label size, the number of
  257.                         labels in a row (1-3) and the number of lines on a
  258.                         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. 
  259.  
  260. Notes
  261. -----
  262. (1) If the print selection contains a 'Text' or 'Text block' field then only
  263. 'Vertical' format may be used and this will be selected automatically. The
  264. line length used to print such fields is given by the 'Text width' value in
  265. the 'Print options' window.
  266.  
  267. (2) In 'Label' format you may include in the print selection one field more
  268. than the number of lines to be printed on each label. A switch in the
  269. 'Label' window will, if set, cause this extra field to be substituted for
  270. another if the latter is blank. You may specify which field is replaced in
  271. this way. Another switch causes the primary key of the record to appear on
  272. each label as a means of identification, which can be useful if the data
  273. printed on the label doesn't make it obvious which record it comes from.
  274.  
  275. Field analysis reports
  276. ======================
  277. The 'Field' submenu has an 'Analyse' option which allows you to print a breakdown of the field contents under certain special circumstances:
  278.  
  279. (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.
  280.  
  281. (b) If the field contains either an 8 or 10 character date (e.g. 19-10-42 or
  282. 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.
  283.  
  284. 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.
  285.  
  286. 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.
  287.                                  
  288. Other features controlled by the 'Print options' window
  289. =======================================================
  290.  
  291. Column headings
  292. ---------------
  293. The headings which appear in all except 'Label' format are either the field
  294. tags or field descriptors depending on the settings of a pair of radio
  295. buttons in the 'Print options' window.
  296.  
  297. Print pitch
  298. -----------
  299. Four radio buttons control the number of characters per inch printed on most
  300. printers.
  301.  
  302. Expand codes
  303. ------------
  304. Causes extra data from a validation table to be substituted for (or added
  305. to) the coded data in fields linked to such tables. See 'Validation' for
  306. further details.
  307.  
  308. Underline
  309. ---------
  310. This switch causes underlining of all output when hard copy is produced, but
  311. not when it appears on the screen. If you print using the 'Table' format
  312. with output sent to a window you will see the vertical lines defining the
  313. blank columns, but not the underlining which divides the table into cells.
  314. If, however, you drag the file to the printer the horizontal lines duly
  315. appear.
  316.  
  317. Upper case
  318. ----------
  319. Causes all textual output to appear in capital letters only.
  320.  
  321. Date stamp
  322. ----------
  323. Causes the date and time at which the report was created to appear as part
  324. of the header information.
  325.  
  326. Header page 1 only
  327. ------------------
  328. Header information not only means column headings in 'Horizontal' and
  329. 'Table' format as described above but also the following:-
  330.  
  331.   * A title derived from the seach formula used to create the report.
  332.   * An optional additional title entered in the 'Print options' window.
  333.   * The data and time stamp (if selected).
  334.  
  335. Normally this information appears at the head of every new page of the
  336. report. Setting the above-named switch restricts the header information to
  337. the beginning of the report and inserts no page breaks within the remainder.
  338. The purpose of this is to allow sensible use of the 'Sort' option which is
  339. available when a report is sent to a window. 
  340.  
  341. Shrink list
  342. -----------
  343. In 'Horizontal' and 'Table' format the width of the columns is determined by
  344. the maximum defined length of the fields included in the print selection.
  345. These lengths are often rather generous compared to the length of data
  346. actually present in the fields, resulting in a lot of "white space" between
  347. the columns. Setting the 'Shrink list' switch BEFORE generating a report
  348. causes Powerbase to make two passes through the data. The first determines
  349. what the ACTUAL, as opposed to the ALLOWED, maximum field lengths are. The
  350. second creates the report using these maxima, thus closing up the space
  351. between columns in most cases.
  352.  
  353. Page length
  354. -----------
  355. Total length of page, including header, footer and top margin. For an A4
  356. page this is 70 lines (the default). Standard fan-fold computer paper such
  357. as is usually used in dot-matrix printers is more likely to be of the page
  358. size known in the U.S.A. as "letter". This requires a page length setting of
  359. 66 lines. In 'Vertical' format Powerbase will try to avoid splitting a
  360. record between pages, but this can happen when the report includes
  361. 'External' text fields ('Text' or 'Text Block') of greatly varying length.
  362. It will also happen, of course, if the number of fields to be printed
  363. exceeds the length of the page!
  364.  
  365. Line spacing
  366. ------------
  367. A setting of 1 (default) leaves no blank lines between the lines of print-
  368. out. 2 results in "double spaced" output. Higher values may be used but are
  369. seldom useful.
  370.  
  371. Title
  372. -----
  373. The normal header information includes a title which Powerbase constructs
  374. from the search formula used to produce the report. This is often quite
  375. sufficient but you may supplement it with a title of your own typed into the
  376. writable icon provided for this purpose.
  377.  
  378. Top and left margins
  379. --------------------
  380. These may be used to adjust the position of the report on the page so that a
  381. short, narrow list may be positioned somewhere near the centre. The top
  382. margin is specified in lines and the left margin in character widths.
  383.  
  384. Text width
  385. ----------
  386. This only affects reports which include 'External' fields of the 'Text' or
  387. 'Text block' type. It specifies the length of line into which such fields
  388. are divided.
  389.  
  390. Column spacer
  391. -------------
  392. The character string in this box is used to specify how the columns are
  393. separated when printing in 'Horizontal' or 'Table' format. Columns are first
  394. padded with spaces to the maximum width of the relevant data field (but see
  395. 'Shrink list' above) and the spacer string is then printed before starting
  396. the next column. The 'Column spacer' box contains 1 by default, meaning
  397. that the default spacer is a single space. A maximum of 5 characters is
  398. allowed. Three interpretations of the contents of this box are possible:-
  399.  
  400. (1) A number by itself means use the specified number of spaces.
  401. (2) A number followed by a non-numeric character means use a string of
  402.     the specified number of that character, e.g. 3- means 3 hyphens.
  403. (3) A non-numeric string is used "as is", e.g. "|" or " | ".
  404.  
  405. Printing single records
  406. =======================
  407. The 'Match' window contains a large button marked 'Print this'. When clicked
  408. this causes only the displayed record to be printed. The field selection and
  409. format are chosen in exactly the same way as for a more extensive report.
  410.  
  411. A second way of printing the displayed record is to press the 'Print' key on
  412. the keyboard. For this to work you must have first saved a field selection
  413. file called 'Default' in the 'PrintRes' subdirectory of the database. If
  414. this file is not found an error message is displayed, otherwise the current
  415. record is printed in 'Vertical' format.
  416.  
  417. The 'Print' key has two other actions which can be useful short-cuts. Used
  418. in conjunction with SHIFT it opens up the 'Match' window. With CTRL it opens
  419. the 'Print options' window.
  420.  
  421.