Products Technologies Demo Docs Blog Support Company

Automatically Format Numbers in Table Cells

TX Text Control X16 table cells support explicit text or number type definitions through the TextType property. Number format strings follow ISO 29500 patterns with placeholders, separators, and percentage signs, automatically applied when cell content or formulas update.

Automatically Format Numbers in Table Cells

Tables have been significantly improved in TX Text Control X16 to support Microsoft Excel compatible formulas. Additionally, table cells can now be explicitly defined to contain text or a number. Number formats can be formatted automatically when the content changes or a formula is getting evaluated.

The following screenshot shows a number in a table cell that is defined as text.

Table format

The TXTextControl.TableCellFormat.TextType property determines whether the cell's text is interpreted as a number or as text.

The following screenshot shows the same content formatted as a number with a specific currency number format:

Table format

When a formula is defined, the automatically calculated text can also be formatted with a number format.

Table format

The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats.

The TXTextControl.TableCellFormat.NumberFormat property is used to set a number format string, that is a composition of placeholders ('#' or/and '0'), separators ('.' or/and ','), percentage signs ('%') and other single characters or text.

A detailed description of these elements can be found in the documentation:

Formatting Text by using Number Formats

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Also See

This post references the following in the documentation:

  • TXTextControl.TableCellFormat.NumberFormat Property
  • TXTextControl.TableCellFormat.TextType Property

Windows Forms

Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.

See Windows Forms products

Related Posts

Windows FormsExcelRelease

Opening Microsoft Excel files with TX Text Control X16

TX Text Control X16 imports Microsoft Excel spreadsheets and converts worksheets into document tables with preserved formatting, formulas, and cell number formats. Using LoadSettings, developers…


ASP.NETWindows FormsExcel

Loading and Processing Excel XLSX Spreadsheet Tables into TX Text Control…

TX Text Control provides a powerful API to load and process Excel spreadsheet tables in .NET applications. This article shows how to load an Excel file and process the tables using TX Text Control…


ReportingExcelRelease

Sneak Peek X16: Excel Formulas and MailMerge

TX Text Control X16 supports over 100 Excel-compatible formulas in table cells combined with the MailMerge reporting engine. Formulas calculate line totals, sums, averages, and item counts within…


ASP.NETWindows FormsWPF

TX Text Control 34.0 SP2 is Now Available: What's New in the Latest Version

TX Text Control 34.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETWindows FormsWPF

TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version

TX Text Control 34.0 Service Pack 1 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…

Share on this blog post on: