Customizing the E-Mail Export Options

I have been using the script found in another post that allows you to automatically export the customer’s email address into Outlook when sending a report to a customer. Unfortunately, I still have to manually fill in the subject line and the body of the email. Luckily today, I found the Email Export Options in the report design tool. Now I am wondering if it is possible to do the following:

  1. I would like to have some of the information flow from the workorder to the email subject line. For example, I would like it to say:

Service Report - {Client Reference Number}

Is it possible to write a script to somehow get the client reference number (and any other fields) into the subject line?

  1. Formatting the Body

How do I format the body using the email export options? When I use this option, anything I type is exported as one long sentence. I would like to format it as follows:

Dear Customer,

Blah blah blah.



  1. Similar to #1 - Can I export Ayanova fields into the body of the email.

Thanks for your help.


I copied the script for exporting the client email, and changed “LT_Client_Label_Email” to “LT_Workorder_Label_CustomerReferenceNumber”

This worked, however, anything I type in the subject export does not appear. Now I need to figure out how to add fixed text before the client reference number.

For example,

Service Workorder for “LT_Workorder_Label_CustomerReferenceNumber”

with “Service Workorder for” always coming before “LT_Workorder_Label_CustomerReferenceNumber”

Hi Imed

For your #1, the forum topic AyaNova-new-email-feature-for-detailed-workorder-reports shows an example of the script for what to place in the subject line:

report.PrintingSystem.ExportOptions.Email.Subject = “Report for Workorder #” + (System.Convert.ToString(DetailReport.GetCurrentColumnValue(“LT_O_Workorder”)));

So if for example, you wanted to have the Subject line show the text “Service Report - {Client Reference Number}” where {Client Reference Number} is the actual data from the LT_Workorder then the specific line of the script would include something like:

report.PrintingSystem.ExportOptions.Email.Subject = "Service Report - " + (System.Convert.ToString(DetailReport.GetCurrentColumnValue(“LT_Workorder_CustomerReferenceNumber”)));

[li]report.PrintingSystem.ExportOptions.Email.Subject identifies to the report template you are referring to the Subject line of an email.
[/li][li]"Service Report - " identifies the preset text as well as the space and the + and another space
[/li][li]i [/i] identifies the specific datafield you then want to display after the preset text

For #2 and #3, I would be happy to provide quotes for these.
Please provide the following as per the forum topic on customizations forum topic Custom-report-templates:

[li] send a private email directly to attention to Joyce, with the following below:
[/li][li] what version of AyaNova are you using? (select menu Help -> About AyaNova -> provide the full number, not just the first number please - i.e.
[/li][li] what grid and/or entry screen do you need this report template to be available from?
[/li][li] export your existing report template that you want further customized to a file as per If is a sample report template that came with AyaNova, please first save a copy of it in your report template designer, then export that copy
[/li][li] if different report templates for the different scripts you listed, please do provide and identify which report template with which

  • Joyce

Awesome, thanks!

I will send this info tomorrow morning as we are close to the end of the day here.

One last request - when exporting a PDF document, is it possible to have the file name of document automatically change to the client reference number as well? AS opposed to “xtraReport1”

Great - will hear from you tomorrow with the requested information and we can go from there!

To change the saved file name when saving a report to a file (whether emailing or directly saving), see the forum post How-to-save-report-file-to-use-workorder-number-instead-of-xtraReport1 (search for
report saved file) for example scripts

  • Joyce

Hi Imed

Just checking in - did you resolve #2 and #3?
We did not receive a private email with your customized exported report template and the other requested details so can take a look and provide a quote if need be. I wanted to make sure whether you sent or not and we just have not received for some reason?

  • Joyce