When MergeField is present in the document, and this merge field is evaluated to an empty string - this, for example, happens when the property in the data source is set to null, empty string, or is missing at all - the result fragment remains in the result document. Instead, it should be removed.
Steps to reproduce:
- Create document with merge field, the field should contain result fragment, and set data source which contains null or string.Empty value for the field:
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
editor.InsertField("MERGEFIELD FirstName ", "«FirstName»");
List<Person> source = new List<Person>()
{
new Person() { FirstName = string.Empty }
};
RadFlowDocument mergedDocument = document.MailMerge(source);
Expected: The result document is empty.
Actual: The result document contains "«FirstName»" string.
Available in LIB Version 2017.3.1120.