What's New in TX Text Control .NET Server 26.0
Track changes, formulas in table cells and the import of Excel workbooks came to TX Text Control .NET Server with version 26.0. Mail merge gained filters, sorting and conditions for merge blocks, and the Document Editor's JavaScript API received get and set methods for most formatting attributes.
Version 26.0 was released on November 14, 2018, as TX Text Control X16, together with TX Text Control .NET for Windows Forms, TX Text Control .NET for WPF, TX Text Control ActiveX and TX Barcode .NET 5.0. Its last full installer, that of Service Pack 1, is dated May 31, 2019. The features below are the ones added since version 25.0.
Version 26.0 at a Glance
| Area | What is new |
|---|---|
| Track changes | Inserted and deleted text marked per user, accepted or rejected in code or in the editor |
| File formats | Import of Excel workbooks (XLSX) with StreamType.SpreadsheetML |
| Tables | Formulas with A1 or R1C1 references, number formats, new keyboard behavior |
| Mail merge | Removal of empty lines, conditions, filters and sorting instructions for merge blocks |
| Document Editor | Track changes on the Proofing tab, formulas on the table layout tab, formatting in the JavaScript API |
Track Changes
With track changes switched on, TX Text Control marks every text change with the user who made it. See Track Changes for the .NET API and Track Changes for the Document Editor.
- Switching it on. In the editor, TextViewGenerator.IsTrackChangesEnabled turns the tracking of new changes on or off. Changes that were already tracked stay marked until they are removed.
- The tracked changes. ServerTextControl.TrackedChanges returns the TrackedChangeCollection of the main text; headers, footers and text frames have their own. Each TrackedChange has a start position, a length, a ChangeKind for inserted or deleted text, a ChangeTime and a UserName.
- Users. A new change belongs to the current user, the first name in the list of user names, such as TextViewGenerator.UserNames. An empty list means an unknown user.
- Accepting and rejecting. The only way to remove a tracked change is to accept or reject it with TrackedChangeCollection.Remove.
- Highlighting. Changes are highlighted in a color per user, red for the current user by default. Inserted text is shown in the color, deleted text in the color and struck through.
- Events. TrackedChangeCreated and TrackedChangeDeleted occur on
ServerTextControl, and TrackedChangeChanged in the editor. Some complex operations, such as deleting a table column, can't be tracked; the editor then raises CannotTrackChange, and the user decides whether the change is made. - File formats. Tracked changes are saved and loaded with the TX Text Control format, RTF, DOC and DOCX.
Excel Workbooks
TX Text Control loads files and memory blocks in SpreadsheetML, the spreadsheet part of Office Open XML and the default format of MS Excel (XLSX). The StreamType enumeration received the value SpreadsheetML.
- Only the first worksheet of a workbook is imported. LoadSettings.GetDocumentPartNames and LoadSettings.DocumentPartName, also new in this version, list and select the parts of a document.
- Formulas that reference cells of other worksheets or other files aren't supported.
Supported File Formats lists the formats of today's version.
Formulas and Number Formats in Tables
A table cell can calculate its content from other cells with a formula, which is loaded from a SpreadsheetML document or set in code. See Tables for the .NET API and Tables for the Document Editor.
- Formulas. TableCell.Formula sets the formula of a cell. The result is updated when an input cell changes, unless IsFormulaCalculationEnabled is
false. A formula cell can be the input of another formula. References to other tables or documents aren't supported. TableCollection.SupportedFormulaFunctions lists the functions a formula can use. - Cell references. FormulaReferenceStyle switches between two notations. A1 names the column with a letter and the row with a number: B3 is the cell in the third row and the second column. R1C1 names both with numbers: R3C2 is the same cell. In R1C1, numbers in square brackets are relative to the formula's cell: R[-3]C[-2] is three rows above and two columns to the left.
- Number formats. TableCellFormat.NumberFormat formats the result. Only formats for positive numbers are supported; TableCollection.SupportedNumberFormats lists them.
- Errors. An invalid formula or number format throws a FormulaException or a NumberFormatException, each with the one-based index of the first invalid character.
- Ruler bars. RulerBarViewGenerator.FormulaMode shows the references of all cells, or of the formula cells only, in the editor's ruler bars, in the notation that
FormulaReferenceStylesets.
Keyboard Behavior in Tables
Two keys work differently in tables since version 26.0:
- The TAB key in the last cell of a table adds a new row at the end of the table.
- The ENTER key at the first input position of a document that starts with a table inserts an empty line before the table.
Mail Merge
MailMerge creates documents from a template and data. Version 26.0 gave it more control over empty lines and over merge blocks, the sections of a template that are repeated for each record.
- Empty lines. MailMerge.RemoveEmptyLines removes lines that are empty after the data has been merged.
- Conditions. MergeBlockInfo.BlockMergingCondition decides whether a block is merged or left out, from a column of the parent data row and a comparison such as "greater than", "is not blank" or "equal to".
- Filters and sorting.
MergeBlockInfo.Filterstakes FilterInstruction objects, which can be combined with "and" and "or".MergeBlockInfo.SortingInstructionstakes SortingInstruction objects, which sort in ascending or descending order by several columns. - Created tables. MergeBlockSettings.CreatedTable and
TableIDdescribe the table thatDataSourceManager.InsertMergeBlockcreated for a block.
See Conditional Content and Sorting and Filtering.
Document Editor
- Ribbon tabs. The Proofing tab received a Track Changes group that switches tracking on and off, accepts and rejects changes and moves to the next or previous change. The table layout tab sets formulas and number formats.
- JavaScript API. Selections, paragraph formats, section formats, page borders, page margins and page sizes received get and set methods for their attributes. TXTextControl.isTrackChangesEnabled switches track changes, loadJsonData loads JSON merge data, and showSideBar shows a sidebar.
Other API Additions
- Loading. LoadSettings received properties such as
LoadImages,LoadHypertextLinks,ImageSearchPath,PageSizeandPageMargins, which appear in the What's New list below. - Saving. SaveSettings.OmittedContent specifies data that is left out when a document is saved.
- Subtext parts. SubTextPart.Data stores additional data with a subtext part as a string.
Upgrade to Version 26.0
- No update notes. No update notes were published for version 26.0.
- Breaking changes. No change of version 26.0 is known to break existing code. Breaking Changes starts with version 30.0.
New Classes, Properties, Methods and Events
These are the classes and members that the What's New documentation of version 26.0 lists for TX Text Control .NET Server. .NET names are relative to the TXTextControl namespace. Each name links to its current reference page, and "(obsolete)" marks the members that are obsolete today. Some classes that existed before, such as LoadSettings and TableCollection, are listed because members were added to them.
New Classes
- CannotTrackChangeEventArgs
- DocumentServer.DataShaping.FilterInstruction
- DocumentServer.DataShaping.SortingInstruction
- FormulaException
- LoadSettings
- NumberFormatException
- TableCell
- TableCollection
- TrackedChange
- TrackedChangeCollection
- TrackedChangeEventArgs
.NET Members by Class
Document Editor JavaScript API
Next Steps
- Version 27.0: the features of the next version.
- Version 25.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X16 and TX Barcode .NET 5.0 Released: the release announcement on the Text Control Blog.