home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / apps / powerbase / Docs / Printing < prev    next >
Encoding:
Text File  |  1994-10-01  |  22.1 KB  |  463 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 tag 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
  187. oxidation state fields has the value 3.“  This could, of course, be entered
  188. as 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. }{does not contain .
  203.  
  204. You may invert the logic of a search criterion by putting NOT in front of
  205. it. To print all non-transition elements you would use NOT GP=T. Note the
  206. space after NOT, and that the syntax isn’t “GP NOT=T”.  You could equally
  207. well use 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{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
  232. target is made by NUMERIC VALUE, e.g. “NUM=5” would match “5”, “05”, “5.0”
  233. etc. For other types of field the comparison is by CHARACTER MATCHING. This
  234. can easily catch you out. Suppose for example you want to print records for
  235. which “NUM<8”. You might be surprised to find records in which NUM contains
  236. values such as 55, 20, or 13 being printed, as well as those containing 4,
  237. 6, 2 etc! If this happens, check that the field is defined as numeric.
  238.  
  239. You can FORCE a comparison-by-value for a non-numeric field by enclosing the
  240. field tag in square brackets, e.g. [NUM]<8 would produce the desired result
  241. in the above example. This is useful where you want to make such a
  242. comparison but still allow the field to accept non-numeric characters. The
  243. comparison-by-value can only work in such cases, however, if the number part
  244. of the field comes first. e.g. it will deal correctly with 55A, 20B, 13X but
  245. not with A55, B20, X13.
  246.  
  247. Record numbers
  248. ==============
  249. It is sometimes useful to have a list of the numbers of records. If you
  250. toggle the ‘Match’ window to full size you will find an option button to
  251. ‘Include record numbers’. These will appear in an extra column at the left
  252. hand side of the report.
  253.  
  254. Print format 
  255. ============ 
  256. The ‘Format’ section of the ‘Print options’ window provides four choices:-
  257.  
  258.         Horizontal      Records are displayed one to a line, the fields
  259.                         being aligned in columns with headings. 
  260.  
  261.         Table           This resembles the ‘Horizontal’ format but each
  262.                         record is underlined and a user-definable number of
  263.                         ruled columns (6 by default) is placed to the right
  264.                         of the text, thus producing a grid. You are advised
  265.                         to set the print pitch to 10 or 12 when using this
  266.                         format. The width of the blank columns is determined
  267.                         by the value in ‘Column width’.
  268.  
  269.         Vertical        Fields are printed underneath each other with the
  270.                         identifier (i.e. tag or descriptor) at the left
  271.                         hand side. The total width of the text (including
  272.                         the identifiers) is determined by the value in
  273.                         ‘Text width’. If the field will not fit onto a
  274.                         single line it is word-wrapped (as on a word-
  275.                         processor) and formatted so that the identifier
  276.                         “hangs” in the left margin.
  277.  
  278.         Label           For printing on special label stationery. A special
  279.                         window lets you set the label size, the number of
  280.                         labels in a row (1-3) and the number of lines on a
  281.                         label. Each field normally appears on a separate  
  282.                         line, but holding down SHIFT while selecting a field
  283.                         with ADJUST causes the selected field to print on
  284.                         the same line as the previous field.
  285.               
  286. Notes 
  287. ——- 
  288. (1) If the print selection contains a ‘Text’ or ‘Text block’
  289. field then only ‘Vertical’ format may be used and this will be selected
  290. automatically.
  291.  
  292. (2) In ‘Label’ format you may include in the print selection one field more
  293. than the number of lines to be printed on each label. A switch in the
  294. ‘Label’ window will, if set, cause this extra field to be substituted for
  295. another if the latter is blank. You may specify which field is replaced in
  296. this way. Another switch causes the primary key of the record to appear on
  297. each label as a means of identification, which can be useful if the data
  298. printed on the label doesn’t make it obvious which record it comes from.
  299.  
  300. Field analysis reports
  301. ======================
  302. The ‘Field’ submenu has an ‘Analyse’ option which allows you to print a
  303. breakdown of the field contents under certain special circumstances:
  304.  
  305. (a) If the field is INDEXED. The menu entry will read ‘Analyse index’. When
  306. chosen it will produce a list of all the values in the index along with the
  307. number of times each one occurs. e.g. A database of college students might
  308. have a field for the school of origin. If there are 20 different schools and
  309. if the field is indexed then a list of those schools will be generated
  310. showing how many students came from each school.
  311.  
  312. (b) If the field contains either an 8 or 10 character date (e.g. 19-10-42 or
  313. 19-10-1942) then the menu entry reads ‘Analyse months’ and a breakdown by
  314. month will be printed. There will be a line for each of the 12 months
  315. showing the number of records for each month. This could, for example, be
  316. used in an orders database to find out quickly how many orders were received
  317. or dispatched in each month. This feature will work on editable ‘Date’
  318. fields and also on ‘Date stamp8’ and ‘Date stamp10’ fields in the ‘Stamp’
  319. class.
  320.  
  321. It is, of course, possible for a field containing a date to be indexed.
  322. Action (a) (above) takes precedence in such a case. You can, however, force
  323. action (b) instead by first selecting the field with ADJUST, then choosing
  324. from the menu.
  325.  
  326. For cases not described above the menu entry simply says ‘Analyse’ and is
  327. shaded. Printing is always to a window (from which the report may, of
  328. course, be saved): the ‘Destination’ buttons in the ‘Print options’ window
  329. have no effect.
  330.                                  
  331. Other features controlled by the ‘Print options’ window
  332. =======================================================
  333.  
  334. Column headings
  335. ———————-
  336. The headings which appear in all except ‘Label’ format are either the field
  337. tags or field descriptors depending on the settings of a pair of radio
  338. buttons in the ‘Print options’ window.
  339.  
  340. Print pitch
  341. —————-
  342. Four radio buttons control the number of characters per inch printed on most
  343. printers.
  344.  
  345. Expand codes
  346. ——————
  347. Causes extra data from a validation table to be substituted for (or added
  348. to) the coded data in fields linked to such tables. See ‘Validation’ for
  349. further details.
  350.  
  351. Underline
  352. ————-
  353. This switch causes underlining of all output when hard copy is produced, but
  354. not when it appears on the screen. If you print using the ‘Table’ format
  355. with output sent to a window you will see the vertical lines defining the
  356. blank columns, but not the underlining which divides the table into cells.
  357. If, however, you drag the file to the printer the horizontal lines duly
  358. appear.
  359.  
  360. Upper case
  361. —————
  362. Causes all textual output to appear in capital letters only.
  363.  
  364. Date stamp
  365. —————
  366. Causes the date and time at which the report was created to appear as part
  367. of the header information.
  368.  
  369. Header page 1 only
  370. —————————
  371. Header information not only means column headings in ‘Horizontal’ and
  372. ‘Table’ format as described above but also the following:-
  373.  
  374.   * A title derived from the search formula used to create the report.
  375.   * An optional additional title entered in the ‘Print options’ window.
  376.   * The data and time stamp (if selected).
  377.  
  378. Normally this information appears at the head of every new page of the
  379. report. Setting the above-named switch restricts the header information to
  380. the beginning of the report and inserts no page breaks within the remainder.
  381. The purpose of this is to allow sensible use of the ‘Sort’ option which is
  382. available when a report is sent to a window. 
  383.  
  384. Shrink list
  385. —————-
  386. In ‘Horizontal’ and ‘Table’ format the width of the columns is determined by
  387. the maximum defined length of the fields included in the print selection.
  388. These lengths are often rather generous compared to the length of data
  389. actually present in the fields, resulting in a lot of “white space” between
  390. the columns. Setting the ‘Shrink list’ switch BEFORE generating a report
  391. causes Powerbase to make two passes through the data. The first determines
  392. what the ACTUAL, as opposed to the ALLOWED, maximum field lengths are. The
  393. second creates the report using these maxima, thus closing up the space
  394. between columns in most cases.
  395.  
  396. Page length
  397. —————-
  398. Total length of page, including header, footer and top margin. For an A4
  399. page this is 70 lines (the default). Standard fan-fold computer paper such
  400. as is usually used in dot-matrix printers is more likely to be of the page
  401. size known in the U.S.A. as “letter”. This requires a page length setting of
  402. 66 lines. In ‘Vertical’ format Powerbase will try to avoid splitting a
  403. record between pages, but this can happen when the report includes
  404. ‘External’ text fields (‘Text’ or ‘Text Block’) of greatly varying length.
  405. It will also happen, of course, if the number of fields to be printed
  406. exceeds the length of the page!
  407.  
  408. Line spacing
  409. ——————
  410. A setting of 1 (default) leaves no blank lines between the lines of print-
  411. out. 2 results in “double spaced” output. Higher values may be used but are
  412. seldom useful.
  413.  
  414. Title
  415. ——-
  416. The normal header information includes a title which Powerbase constructs
  417. from the search formula used to produce the report. This is often quite
  418. sufficient but you may supplement it with a title of your own typed into the
  419. writable icon provided for this purpose.
  420.  
  421. Top and left margins
  422. ——————————
  423. These may be used to adjust the position of the report on the page so that a
  424. short, narrow list may be positioned somewhere near the centre. The top
  425. margin is specified in lines and the left margin in character widths.
  426.  
  427. Text width
  428. —————
  429. This specifies the line length used when printing in ‘Vertical’ format.
  430.  
  431. Column spacer
  432. ——————-
  433. The character string in this box is used to specify how the columns are
  434. separated when printing in ‘Horizontal’ or ‘Table’ format. Columns are first
  435. padded with spaces to the maximum width of the relevant data field (but see
  436. ‘Shrink list’ above) and the spacer string is then printed before starting
  437. the next column. The ‘Column spacer’ box contains 1 by default, meaning
  438. that the default spacer is a single space. A maximum of 5 characters is
  439. allowed. Three interpretations of the contents of this box are possible:-
  440.  
  441. (1) A number by itself means use the specified number of spaces.
  442. (2) A number followed by a non-numeric character means use a string of
  443.     the specified number of that character, e.g. 3- means 3 hyphens.
  444. (3) A non-numeric string is used “as is”, e.g. “|” or “ | ”.
  445.  
  446. Printing single records
  447. =======================
  448. The ‘Match’ window contains a large button marked ‘Print this’. When clicked
  449. this causes only the displayed record to be printed. The field selection and
  450. format are chosen in exactly the same way as for a more extensive report.
  451.  
  452. A second way of printing the displayed record is to press the ‘Print’ key on
  453. the keyboard. For this to work you must have first saved a field selection
  454. file called ‘Default’ in the ‘PrintRes’ subdirectory of the database. If
  455. this file is not found an error message is displayed, otherwise the current
  456. record is printed in ‘Vertical’ format.
  457.  
  458. The ‘Print’ key has two other actions which can be useful short-cuts. Used
  459. in conjunction with SHIFT it opens up the ‘Match’ window. With CTRL it opens
  460. the ‘Print options’ window.
  461.  
  462.  
  463.