In TX Text Control X16, Excel compatible formulas can be used in table cells to calculate results based on values and references to other cells in the same table. More than 100 different formulas are supported and can be combined.

This feature gets even more powerful when used in combination with TXTextControl.DocumentServer.MailMerge class TX Text Control .NET Server for ASP.NET
DocumentServer Namespace
MailMerge Class
The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services.
- TX Text Control's reporting engine to merge templates with data from various data sources.

The following screenshot shows a list of invoice items created with MailMerge:

Invoice with Excel formulas

The data for this example is a very simple XML:

<name>Road-650 Red, 44</name>
<name>Road-450 Red, 52</name>
<name>HL Mountain Frame - Black, 38</name>
<name>AWC Logo Cap</name>
<name>Mountain-100 Black, 38</name>
<name>Sport-100 Helmet, Blue</name>
view raw data.xml hosted with ❤ by GitHub

In the above XML source, you can see that only 4 data points are available:

  • qty
  • name
  • unit_price
  • discount

The other columns in the table are calculated based on these values.

Invoice with Excel formulas

The following screenshot shows the formula of the Line Total column in the ribbon UI. The value is calculated based on quantity multiplied the unit price minus discount.

Invoice with Excel formulas

The Total value is calculated with the following formula that creates a sum of all numeric rows above in the same column:


Additionally, two values are calculated based on the existing data in the table.

  • Average discount:
  • Number of items:

In this sample template, another new feature of MailMerge is used: Sorting. The complete list is sorted by unit price:

Invoice with Excel formulas

This sample shows the power of MailMerge in combination with Microsoft Excel compatible formulas. The major advantage of using formulas is that data, that could be calculated, must not be stored in your data source or must not be calculated in your business object. TX Text Control is doing this for you when the data is required.

Another great idea of TX Text Control X16 - stay tuned for more.