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:

Template

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; }
}
view raw class.cs hosted with ❤ by GitHub

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);
view raw cs.cs hosted with ❤ by GitHub

Template

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
}
};
view raw class.cs hosted with ❤ by GitHub

Template

Read more about the optional MergeSettings in the Web API references at:

docs.reporting.cloud

Happy coding!