+1 vote

Hi we use a report system that spits out a generated report on the fly to html which we then feed into the template part of mail.dll

However when mail.dll tries to load up the report it is not happy about some code and gives error. below and we have found this to be a tag withing the html

<!--[if lt IE 9]>

Activity: GenerateTicket

Exception Message: 'lt' was not found.

Stack Trace: at .GetValue(String name)
at .Render(StringBuilder writer)
at Limilabs.Mail.Templates.Template.<>cDisplayClass17_0.b1( x)
at System.Collections.Generic.List1.ForEach(Action1 action)
at Limilabs.Mail.Templates.Template.Render()
at EnergyDriveSystems.Module.WorkFlows.GenerateTicket.Execute(NativeActivityContext context) in D:\Dropbox (EnergyDrive)\PROGRAMMING\SVN EDS\EnergyDriveSystems.Module\WorkFlows\GenerateTicket.cs:line 109
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

by (250 points)

1 Answer

0 votes

You need to escape special characters such as '[' and ']' with '\[' and '\]'.

Those characters are used for substitution and flow control:

[if IsEmployee]
   Employee [FirsName] [LastName]
[else]
    This is an escaped character: \[ 
[endif]
by (297k points)
Hi we have no control over the export of the actual report currently and this is done directly via devexpress reporting component
You need to escape special characters. You can do that after it is generated, before you set the template.

Are you sure that you need the template engine at all?
...