The data that I am retrieving is stored in the database with some HTML markups in it, example:
One of my merge fields contains this text:
<ul><li><strong>Bullet Title 1</strong>Bullet content 1.</li><li><strong>Bullet Title 2</strong>Bullet content 2.</li></ul>
Another one of my merge fields contains this text:
<strong>List of employees</strong><br />First Name< br />Second Name<br />Third Name
But when the document renders, the fields show the html tags instead of rendering the formatted text.
How can I accomplish the merge field to show the formatted text instead of the html tags?
- Code: Select all
Public Shared Sub FieldMerge(ByVal ds As DataSet, ByRef doc As Document)
'**********************************
'Merging
'**********************************
Dim fieldNames As New List(Of String)()
Dim fieldValues As New List(Of String)()
For Each dtcolumn As DataColumn In ds.Tables(0).Columns
'Add the values to the list of string
fieldNames.Add(dtcolumn.ColumnName)
'**** THIS TEXT COULD HAVE SOME HTML TAGS - HOW TO RENDER THIS IN THE MERGE FIELD???? *****'
fieldValues.Add(ds.Tables(0).Rows(0)(dtcolumn.ColumnName).ToString)
Next
Dim fieldNamesArray As String() = fieldNames.ToArray()
Dim fieldValuesArray As String() = fieldValues.ToArray()
'Execute the merge
doc.MailMerge.Execute(fieldNamesArray, fieldValuesArray)
End Sub