We just rolled out a new MergeSettings property that can be used to remove a complete line, if this line consists of empty merge fields only.
Consider the following template segment:
The following class is our data source for the merge process:
public class Report | |
{ | |
public string name { get; set; } | |
public string company { get; set; } | |
public string blank { get; set; } | |
} |
When the merge field blank is not used (is empty), an empty blank line will be rendered:
Report report = new Report() | |
{ | |
company = "Text Control, LLC", | |
name = "Bjoern Meyer" | |
}; | |
TXTextControl.ReportingCloud.ReportingCloud rc = | |
new TXTextControl.ReportingCloud.ReportingCloud( | |
"user@domain.com", | |
"yourpassword", | |
new Uri("https://api.reporting.cloud/")); | |
MergeBody body = new MergeBody() | |
{ | |
MergeData = report | |
}; | |
List<byte[]> documents = rc.MergeDocument(body, "RemoveEmptyLines.tx", ReturnFormat.TX); |
When the removeEmptyLines property is set to true, this empty line gets removed when merging the document:
MergeBody body = new MergeBody() | |
{ | |
MergeData = report, | |
MergeSettings = new MergeSettings() | |
{ | |
RemoveEmptyLines = true | |
} | |
}; |
Read more about the optional MergeSettings in the Web API references at:
Happy coding!