Generate Mail Merge Letters from an Ad hoc Report
GENERATE MAIL-MERGED LETTERS FROM AN AD-HOC REPORT
You can export the results of an ad-hoc report into a mail merge using a pre-prepared template. The report should contain all of the fields that you want to include in your letters and the mail merge tokens will be numbered according to the order of those fields in the report results.
Note: It is important, therefore, that you do not change the order of the fields in the Select Clause in the ad-hoc report once the template has been created.
Create a Letter Template
- Launch **OpenOffice Writer **
-
Note: OpenOffice Writer defaults all documents to be in a book style format and you should amend the print settings as follows to avoid printing a blank page between each printed page.
-
Click the Tools Menu and Options.
-
Click the + symbol to the left of Open Office Writer
-
Remove the tick from Print Automatically Inserted Blank Pages.
There is no facility to save this modification to an existing document, so click File>Save As and save the document as your new template. Open this new template to continue.
-
Type the non-variable text, ie standard text, into your letter and save the template – without closing it.
-
To add today’s date to the template:
-
place your cursor in the position that you wish to display the date, > click on the Insert menu and click Fields and then > Other;
-
click on the Documents tab and in the Type column, click > Date;
-
in the Select column, click Date ( class="underline">not Date Fixed);
-
in the Format column, select your required date format and
-
Click Insert.
-
To add your field tokens to the template, click on the Database tab and then click on Mail Merge Fields.
-
Click the + symbol to the left of the Middleman database to display the tables in the database and then click the + symbol to the left of AdHocMailMerge to display the tokens in the table.
-
You
can now add the required tokens to your template.
They are numbered Col01-Col99 and these relate to the order that the data columns are displayed in your ad-hoc report, ie Col01 is the first column, etc. There are also additional tokens for Customer Ref (CustomerRef) and Animal Ref (AnimalRef) if these are not displayed.
You can either double-click on each token so that they appear one after the other in the template and re-position them later or place your cursor where you would like each token to be positioned and then double-click the token (or you can click on each token and click Insert if you prefer this to double-clicking). You can click between the template and the Field Selection screen when inserting field tokens.
- When all of the tokens have been added, click Close and Save the template in the Templates folder in same path where all of your other Assisi documents, ie consent forms, are stored. If you are not sure of the correct path, please contact Support for advice.
Run the Ad-hoc Report
- Select Reporting>Ad-hoc Reporting.
-
Click Open then browse for and double-click the required report.
-
Execute the report, the results will be displayed on the bottom half of the screen for checking.
Complete The Merge
- Click Merge on the toolbar.
-
Browse for and select the template and click Open.
-
An OpenOffice document will be created with individual pages for each record identified in the report, ready for printing and saving.