Jump to main Content | Jump to main Navigation

Customising report fields

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, on the Standard Mail Merge Reports page). 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 make 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