Products Technologies Demo Docs Blog Support Company

ReportingCloud: New MergeSettings property to remove empty lines

The ReportingCloud Web API adds a removeEmptyLines property to MergeSettings that removes blank lines from merged documents when all merge fields on a line are empty. This prevents unwanted gaps in address blocks, form letters, and templates where optional data fields may be missing.

ReportingCloud: New MergeSettings property to remove empty lines

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; }
}

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);

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
    }
};

Template

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

docs.reporting.cloud

Happy coding!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Reporting

The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.

See Reporting products

Related Posts

ReportingReportingCloudTrack Changes

New Endpoint: Manipulating Tracked Changes in Documents

ReportingCloud adds API endpoints for manipulating tracked changes in documents. The trackedchanges endpoint retrieves metadata including change type, timestamp, and highlight color. A companion…


ReportingConferenceReportingCloud

Impressions from Developer Days Magdeburg 2019

Text Control sponsored the sold-out Developer Days Magdeburg 2019, presenting the latest product versions and technologies at its booth. The team raffled off an Xbox One during the closing session…


ReportingConferenceReportingCloud

See Text Control at DEVintersection, Orlando

Text Control exhibits at DEVintersection Spring 2019 in Orlando from June 11 to 13, presenting the upcoming TX Text Control X17 with high DPI support and Visual Studio 2019 compatibility. The…


ReportingConferenceReportingCloud

Impressions from dotnet Cologne 2019

Text Control sponsored the community-driven dotnet Cologne 2019, presenting products across all platforms with branded frisbees and stickers. The sold-out event attracted enthusiastic developers…


ASP.NETReportingWindows Forms

Creating Templates: Typical Invoice Elements

Building an invoice template with TX Text Control uses JSON data, merge fields, repeating blocks, and Excel-compatible formulas. Line totals, tax, and discounts compute directly in the template…

Share on this blog post on: