home *** CD-ROM | disk | FTP | other *** search
- Ch 9 − Mail-Merging with Impression and Ovation
-
- Although the title refers to “Mail-Merging” the process to be described is
- more accurately termed “Data-Merging” as it is by no means limited to
- merging names and addresses into letters; any kind of textual data from a
- Powerbase application can be merged into any kind of document in Impression
- or Ovation or many other editors and wordprocessors.
-
- 9.1 Mail-merging with Ovation*
-
- Ovation expects data for merging to be supplied as a CSV file (see Ch 8). An
- example file (OvationCSV) is supplied with this version of Powerbase. It was
- created from the Elements database and is intended to work with the sample
- Ovation document OmergeTest. Before attempting to create CSV files of your
- own you are recommended to read the Powerbase documentation on such files.
- The process for mail-merging with Ovation is described below.
-
- 9.1.1 Preparing an Ovation document for mail-merging
-
- Ovation has a very easy method of specifying where the merged data is to go
- into the document. Whenever you reach a point where you wish to insert a
- Powerbase field type Ctrl I. A window headed “Merge tag” will appear
- inviting you to enter a number. The number required is the field number in
- the CSV record (which is not necessarily the field number in the Powerbase
- record). If, for instance, you wish to merge the second field from each line
- of your CSV file enter 2 and type Return. You will see that “[Merge2]” has
- been inserted into the text at the caret. Continue typing, inserting other
- fields as required. The fields do not need to be in numerical order (you can
- insert field 2 before you insert field 1) and the same field may be inserted
- many times. Styles and effects may also be applied to the Merge tags. Load
- MergeTest to see how this looks.
-
- 9.1.2 Merging the data from Powerbase
-
- With MergeTest loaded open the main Ovation menu, go to the File submenu and
- choose Print. Select the Mail merge option button and drag OvationCSV to the
- writable icon to the right of the button. The pathname of the file will
- appear in the icon. Click on OK and the document will be printed once for
- each record in the CSV file, merging new data into the document each time.
- OvationCSV contains 10 records so if you just want to see the process in
- action without actually printing 10 sheets of paper set your printer manager
- to print to a file instead of to the printer itself.
-
- If you examine OvationCSV you will see that each field is enclosed in
- quotes. This is only necessary of the fields contain literal commas (see
- 8.1). Look at the first record, for example, and note the comma in
- “(Gr.aktis,aktinos; ray or beam)”. Without the quotes Ovation would
- interpret the comma as a field separator and the merging would get out of
- step for that record.
-
- 9.2 Mail-merging with Impression
-
- The following description applies to Impression Publisher and Impression
- Style. The older ImpressionII is also supported. Powerbase and Impression
- are able to communicate directly with each other without the need for a CSV
- file. This task is performed by a module called ImpulseII which Computer
- Concepts have placed in the public domain to encourage its adoption as a
- standard means of transferring data between RISC OS applications. The
- ImpulseII module is included in the Resources directory inside the Powerbase
- application directory.
-
- 9.2.1 Preparing the Impression document
-
- Since the merged data is not being supplied from a pre-generated CSV file
- Impression needs to request specifically each Powerbase field that it wants
- to merge into the document. It is probably best to create the document
- without worrying about the merged data at first, then insert the necessary
- commands afterwards.
-
- Wherever you want data from a Powerbase record to appear in the document
- proceed as follows:−
-
- (1) Place the caret at the point where the data is to be inserted.
-
- (2) Click MENU over the frame, go to the Utilities submenu (Misc in
- ImpressionII) and choose Merge command A dialogue box will appear.
-
- (3) Type the following:−
-
- :Powerbase GetField NAME
-
- This is on the understanding that your Powerbase record contains a
- field whose tag is NAME and that you want the contents of that field
- inserting into the Impression document at that point. Note the spaces and
- the initial colon. These are essential.
-
- (4) Click on Set or type Return. You will see “<NAME>” appear in the
- text.
-
- (5) Repeat for all the other Powerbase fields to be inserted in the
- document. All take the form:−
-
- :Powerbase GetField <tag>
-
- and in each case the tag, enclosed in angle brackets, will appear in
- the text.* All the data in a given document must come from the same
- database. It might be easiest if you open the required database and arrange
- the desktop so that you can see both the record window and the Impression
- document. Clicking MENU over a field makes its tag appear in the second menu
- item.
-
- (6) Save the the document!
-
- 9.2.2 Merging the data
-
- (1) Make sure Impression has been “seen” by the filer. Impression
- doesn’t need to actually be on the icon-bar at this point but it doesn’t
- matter if it is.
-
- (2) Open the Powerbase database.
-
- (3) Drop the Impression document on the record window. If Impression
- isn’t already running Powerbase will run it for you. The document will be
- loaded and displayed. Finally Powerbase’s Data merge window will appear.
-
- (4) The Data merge window features the familiar Query panel into which
- you may enter a search formula. Clicking on Merge or typing RETURN then
- extracts data from the first matching record and inserts it in the specified
- places in the Impression document. If no search formula was entered the
- merged record will be the first in the current subfile.
-
- (5) Buttons are provided for Next, Previous, First and Last record.
- These work just like the corresponding keypad buttons and the Impression
- document displays the merged data in each case.
-
- (6) Clicking on Print will print the Impression document in its
- displayed state, i.e. with the currently merged data. If you select the
- Print all switch before clicking on Merge a whole series of hard copies will
- be produced, one for each matching record.
-
- Note that when the mouse pointer is moved over the Impression document with
- the merged data present it changes to a large red and blue cross which means
- that you cannot edit the document. Clicking SELECT over it has no effect;
- the caret doesn’t appear. If you click on Cancel in the Data merge window
- the merged data is removed from the document and normal editing is restored.
- If you do want to edit the document with merged data present then click on
- Edit. Note, however, that if you save the document in this state it will be
- saved with the specific data you have merged into it rather than with the
- commands to merge data.
-
- A full description of the Impulse commands or “methods” which Powerbase
- understands will be found in Appendix A.
-
- 9.3 Mail-merging with other programs
-
- If you use neither Impression nor Ovation you may still be able to use
- mail-merging with your wordprocessor, but you will need to read the manual
- carefully to find out how. It will almost certainly involve a CSV, or
- similar, file in conjunction with some method of “tagging” the document (as
- described above for Impression and Ovation) to specify where in it the data
- is to be merged.