Creating a New Excel Template Message Style in LIMS Messaging
Summary
The information in this article applies to LIMS 3.0 or newer.
LIMS Messaging includes message styles that generate emails with attached files in a number of different formats including Excel and PDF files created from Excel. If you have created your own Excel final report template from one of the LIMS example templates, this article shows you how to add a new message style for your template so you can automatically send your final reports with LIMS Messaging.
More Information
LIMS Messaging is used to automatically send final reports with sample results in real time via email or fax when either a single sample or a batch of samples is completed in the LIMS. Message styles determine the format of the email and the type of any attached file. Available message styles include plain text and attached files in rich text, snapshot, HTML, XML, Excel, and PDF formats. Additional attachment file formats are possible using a new message style with a custom eXtensible Stylesheet Language (XSL) transformation. See the LIMS Messaging User’s Guide for more information on XSL transformations.
If you have created a custom Excel final report template, simply add a new message style for your template to automatically send emails with either an attached Excel workbook or PDF file created from your template. Note that only Excel templates designed for LIMS’ Sample Summary report can be used in a new message style.
Follow the steps below to add a new completion message style for your Excel final report template. These procedures assume LIMS Messaging is already installed. See the LIMS Messaging User’s Guide for complete installation instructions.
Step One: Create, Install, and Test your Excel Template
Step Two: Create a New Message Style
Step Three: Test the New Message Style
Step One: Create, Install, and Test your Excel Template
If you have not already created a final report template, you can copy, rename and modify one of the following example Excel templates installed by LIMS in folder C:\LIMS\Examples\Excel Export Templates:
CofA Example.xlt Final Report - Samples in Columns.xlt Final Report - Samples in Rows.xlt Final Report Example.xlt
Note that the CofA Example template is a single-sample report and should only be used with single-sample completion message styles.
Install your new template by copying the template file to your Excel exports template folder, which is specified on the Workstation Configuration screen on the Admin menu in the LIMS. In an LIMS multi-user installation, the Excel exports template folder should be a shared folder on the file server that is accessible to all LIMS workstations and to LIMS Messaging. Use the [Configure] button in LIMS Messaging and set the Excel templates folder on the Settings tab to the same folder.
To test your template first close Excel, preview a Sample Summary report in LIMS, use File | Export to MS Excel Template, then select your template from the list of available templates. Your report should appear in Excel and the workbook should include a single worksheet. If the resulting Excel workbook includes additional worksheets including the LIMSData worksheet, enable the Remove Infrastructure option on the template’s Settings sheet then retest. Removing the infrastructure sheets is particularly important if you plan to add a PDF message style for your template. Once your template is working properly proceed to step two.
Step Two: Create a New Message Style
Start LIMS Messaging, click the [Configure] button then select the Message Styles tab of the configuration screen. Determine whether your message style will be for a single-sample or a sample batch and whether you will send an Excel workbook or a PDF created from the workbook. Copy one of the styles listed below to create your new style. Select style 108 or 109 for a single-sample message or style 158 or 159 for a batch message. Select either the XLS or PDF style.
StyleID | Name |
108 | Completion with XLS file (CofA Example.xlt) |
109 | Completion with PDF file (CofA Example.xlt) |
158 | Batch Completion XLS (Final Report Example.xlt) |
159 | Batch Completion PDF (Final Report Example.xlt) |
Click the record selector to the left of the StyleID to select the style to copy. Use Ctrl+C to copy the style. Now click the asterisk (*) for the new record at the bottom of the list of styles and use Ctrl+V to paste the copied style. Enter a new unique internal StyleID. For example, use a StyleID of 200, 201, etc. to identify your custom message styles. Replace the example template name in the style’s Name with your template name. Note that all batch message style names must begin with the word “Batch.” Figure 1 below shows a new PDF batch message style added for template My Final Report.xlt.
Figure 1 Adding New Message Style
Use the [Tab] key to select the new style’s Expression field then use Shift+F2 to open the Zoom window to edit the expression. Replace only the example template name in the style’s Expression with the exact name of your template then click the [OK] button to close the Zoom window.
Figure 2 Editing Message Style Expression
Enter your name or initials, the current date, and any comments in the style’s Notes field to identify your custom style. Click the [OK] button to save your style and close the configuration screen.
Figure 3 Adding Message Style Notes
Step Three: Test the New Message Style
If you haven’t already done so, click the [Configure] button on the LIMS Messaging main screen then select the Test Messages tab of the configuration screen and change the default email address in the Recipients field to your own email address. If you are unfamiliar with the Recipients field syntax, use the [Build…] button adjacent to the Recipients field to edit the Recipients field. Updating the Recipients field will change the default recipient for all future LIMS Messaging test messages. Click the [OK] button to close the configuration screen.
Figure 4 Default Test Message Recipient
On the LIMS Messaging main screen click the [Test] button. Select a sample from the pick list of recently completed samples then select your new message style. Click the [Send] button to send the test message. You should receive a confirmation indicating your message was sent successfully.
Figure 5 Sending a Test Message
Exit and restart LIMS and your new completion message style will now be available in the pick lists on the Messaging tab of both the Projects and Customers setup screens.