Jump to main Content | Jump to main Navigation

Standard Mail Merge Reports

Calm can be used to produce text-based reports, such as those for Accession Registers, Receipts for Accessions or Catalogue Reports, using the Mail Merge facility in Microsoft Word. For further examples see the complete List of Reports.

Please note: The instructions provided in this manual relate to versions of Word that are currently supported by Microsoft. These are; Office XP/2002 (version 10), Office 2003 (version 11) and Office 2007 (version 12). Instructions for older versions of Word are not included as they are no longer supported by Microsoft.

Mail Merge reports use data exported from your Calm records in combination with Word Templates to create Word Documents. The Word Templates have the file extension .dot and are located in the Calm folder. (When Calm is installed, master copies of the Word templates are supplied in the Calm templates folder - usually dscribe\archive\templates. When you log into Calm for the first time, these templates are copied to your Calm output folder - usually dscribe\archive\output. If you have already modified these templates to create your own versions, they will not be overwritten, but the originals will remain in the templates folder.) The data from your Calm records is exported as a text file with the extension .txt into the Calm output folder. Please Note: In a client/server configuration, these folders are found on the client PCs. Any changed files will need to be copied to other client PCs if they are to be employed by all Calm users.

If Word is not installed on your computer then the data can be exported into any word processing package with an appropriate template set up. Contact the Calm Help Desk for details.

The standard Word templates that are provided with Calm can be customised to suit your individual requirements.

When you run a Mail Merge report the data that is exported from your Calm records is controlled by a file called mailmrg.ini. This file can also be customised to change the data that is exported when a particular report is run.

For more complex reporting requirements Axiell offers a Custom Reports design service.

Running a Mail Merge report from Calm

Mail merge reports are usually accessed via the side button strip in Calm. Click the Reports > button followed by the button for the report you require. The default template for the report you have chosen will open in Word. The procedure for creating the report will vary depending on the version of Word you are using. Select the 'Mailings' tab, click on 'Finish & Merge', then choose 'Edit Individual Documents...' from the dropdown list, choose 'All' on the 'Merge to New Document' dialogue box, then press OK to merge the data from your Calm records into the template. In older versions of Word, click the "merge to new document" icon on your mail merge toolbar or use the Mail Merge wizard available from the 'Letters and Mailings' option on the 'Tools' dropdown menu.

Please Note: Depending on your version of Microsoft Office, when Word opens, a dialogue box may ask you to confirm that you want data from your database to be used. Click Yes to proceed. If you require further details, please consult your Microsoft Office documentation.

There are specific instructions for each individual report throughout this guide. For example, see the Accessions database section for Archival Accession Receipts and Accession Register reports.

When you have produced the report you can use the Word printing features to create a paper copy of the document. 

Working with the Mail Merge Templates in Word

Default mail merge templates are provided with Calm. These will automatically open when mail merge reports are run, however they may be customised to reflect your in-house style or to meet individual requirements.

If you wish to customise a template, first run the report from Calm. This will allow you to view the template to decide what customisations to make, and will also enable Microsoft Word to associate the correct data source with the template.

After you have run the report for the first time, close it without saving any changes. You are now ready to edit the default template.

The default templates are located in the Calm templates folder (usually DScribe\Archive\Templates) on your Calm client PC. The Word templates are those files ending .dot. It is advisable to save a copy of the template in case you need to revert to the original in future. To open the template for editing, in Word, select the report name you require, right click, and click Open. Please note: You must open the template from within Word.

Use Microsoft Word features to edit the template, for example by adding text, page numbers, headers, footers and formatting the report as required.

The report templates also contain "merge" fields, which tell Microsoft Word where to place data from your Calm records when it is merged with the template. These appear as field names with chevrons at either end. By adding and removing merge fields you can alter the location of your Calm data on a report. To insert new merge fields, choose the 'Mailings' tab, then click the 'Insert Merge Field' icon in Word. (In older versions of Word, click the 'insert merge field' icon on your mail merge toolbar). You will see a list of merge fields that are available to be added. If the field you wish to add to the report does not appear (for example if it is a field you have added to the record type, or a field from a record in a linked database), you can edit the Mailmrg.ini file to add it to this list.

When you have made the required changes, save the template in the output folder (usually DScribe\Archive\Output), using its original file name. Please Note: renaming the file will stop the report from running properly. Close the file, return to Calm and run the report again. When the report is run from now on, Calm will use the updated template. 

Customising the mailmrg.ini file

The mailmrg.ini file is created the first time you exit Calm. It dictates which fields are exported from your Calm records for use in your report templates. You may need to edit mailmrg.ini if you want additional fields to be exported for use in reports. For example, if you have catalogue records linked to records in the locations database, and want a Catalogue report to include information from the location record.  

Mailmrg.ini is located in the Calm folder (usually DScribe\Archive) on your Calm client PC. Please Note:

  • You must exit Calm before opening mailmrg.ini, to ensure that your changes are saved.
  • It is advisable to take a copy of mailmrg.ini before opening it to edit, as you may need to revert to the original file in future.
  • It is essential that you open mailmrg.ini with a text editor such as Notepad. Never use Microsoft Word or any other word processor as this will add formatting which could prevent Calm from working properly.

Understanding the Mailmrg.ini file

Mailmrg.ini is divided up according to the name of the report in Calm, for example:

  • Museums Receipts
  • Catalog export {Mail Merge} – for the Archive catalogue export.

Each report is laid out in columns and each line (row) in the file relates to an individual mailmerge field which will appear in the Word mailmerge report. For example the following is extracted from the section that deals with the Museum Receipts report:

{ Number {ObjectEntry LoanIn} {} {EntryNumber} "" ""}

{ Owner {ObjectEntry LoanIn} {} {OwnerId} "" ""}

{ OwnerText {ObjectEntry LoanIn} {OwnerData} {DpstrName DpstrBody Address} "\n" ""}

{ Depositor {ObjectEntry LoanIn} {} {DepositorId} "" ""}

{ DepositorText {ObjectEntry LoanIn} {DepositorData} {DpstrName DpstrBody Address} "\n" ""}

}


The column layout used in Mailmrg.ini is:

Element

Word Name

Record type/s

Join Name

Field/s

Field Separator

Repetition separator

Explanation

The word which appears in chevrons on the word document

The record types within the database to which this applies.

If you want to use a field from a linked database in your report, enter the name of the link here. Otherwise leave blank.

Please note: find the name of the link by scrolling to the bottom of the appropriate record to where the read only fields from linked databases are placed. The Join Name is the "heading" for these fields".

Which field or fields you want to export.

If you want to export two or more fields as a unit (eg Depositor Name and Depositor Address), enter the field names here in the order you want them to appear. How you want them to appear (e.g. separated by commas or line breaks) is controlled by the field separator element.

Please note: you must use the system field name here, i.e. the one used in Admin. If you have relabelled fields and have not kept a record of this, go to a record that contains the particular field and put the cursor in the field, the original name can be found in the status bar at the bottom of the screen.

If exporting more than one field, enter data here to show how you want them to be arranged:

If you leave this element blank, then the content of the fields will appear next to one another, with no spaces.

If you want the data to tab across the page (i.e. appear in columns) use \t

If you are exporting more than one field/set of fields, this element determines how they will be presented.

Use \n to put in a line break.

Example 1

{Object

{ObjectEntry LoanIn}

{MuseumCatalog}

{ObjectNumber ObjectName}

": "

"\n"}

Explanation

When the mailmerge report is launched, Object will be available as a mailmerge field

The data will be exported from the Object Entry and LoanIn templates in the Museum Object Entry/Loan In database.

The data will be taken from fields in the linked catalogue record/s.

Data will be taken from the Object Number and the ObjectName fields in the linked catalogue record/s.

The Object Number and Object Name fields will be separated by :

Each set of ObjectNumber and Object Name fields will be put on a new line

Example 2

{ Number

{ObjectEntry LoanIn}

{}

{EntryNumber}

""

""}

Explanation

When the mailmerge report is launched, Number will be available as a mailmerge field

The data will be exported from the Object Entry and LoanIn templates in the Museum Object Entry/Loan In database

The data will be drawn from a field in the main catalogue record.

Data will be taken from the Entry Number field.

   

Please note: the order of the fields does not affect mailmerge reports – you select where to put the data in the mailmerge template file (see Working with the Mail Merge Templates in Word, above). However, in Excel reports, the order the fields appear in the spreadsheet is determined by the order in which they appear in the mailmerge.ini file.

Amending the mailmrg.ini file

  • Ensure you do not have any Calm applications open on your PC 
  • Take a copy of the mailmrg.ini file – that way, if you may a mistake you can restore the original version.
  • Open the mailmrg.ini file in a text editor
  • Navigate to the report you wish to amend.
  • Either: Construct a new line, remembering to include all six elements and brackets at the beginning and end of the phrase {}
  • Or: add a new line into mailmrg.ini in the appropriate place, by copying an existing line and amending.
  • Close the mailmrg.ini file

Example: to add the Location field from the Locations database to an archive catalogue report:

  • Within the Mailmrg.ini, search for the string "ArchiveCatalogue" until you find the export list for the archive catalogue fields. The start of the section will look something like this:

            set ::ExportList_ArchiveCatalogue

  • At the end of the above line, press Return to insert a new blank line.
     
  • Following the column layout outlined above, add the following line into the blank space:
  • { Location {} Location Location "" ""}

  • Save and close Mailmrg.ini
     
  • When you next run the ArchiveCatalogue report, Calm will export the Location field from any linked Location records as well as the usual catalogue fields; you can then add this field to your ArchiveCatalogue.dot template.

Please contact the Helpdesk if you need help on adding fields to the templates or any other information on the mail-merge templates.


Examples of field formatting using the Field Separator and Repetition Separator:

{DepositorName DepositorAddress} "\t" ""
Depositor Name    Depositor AddressDepositor Name2    Depositor Address2

{DepositorName DepositorAddress} "\t" "\n"
Depositor Name    Depositor Address
Depositor Name2    Depositior Address2
Depositor Name3    Depositor Address3

{DepositorName DepositorAddress} "\t" " and "
Depositor Name    Depositor Address and Depositor Name2    Depositor Address2

{Author Book} {Book} {} {Author} "" "; "
Author; Author2 *

* Where there is more than one Author field in a book record template