In this blog post, I’ll describe Office-related features available in our Early Access Preview build. If you own an active Universal Subscription, feel free to download this Early Access Preview (EAP) build at your convenience.
This EAP may not include all features/products we expect to ship in our v23.1 release cycle. As its name implies, the EAP offers an early preview of what we expect to ship in two months.
Word Processing Document API and Rich Text Editors (WinForms and WPF)
Embedded Fonts
Our new font embedding option allows you to include font files within a document. As you would expect, once fonts are embedded, a document can be viewed and printed on any computer (regardless of font availability on the target machine).
The following DevExpress Word Processing libraries now offer embedded font support:
You can use the Document.EmbedFonts property to determine whether to embed fonts in a document. The code sample below loads a document to a RichEditDocumentServer instance, formats the document header and applies the Chiller font, enables font embedding, and saves the result to a folder on the OneDrive cloud.
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Diagnostics;
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
wordProcessor.LoadDocument(@"C:\Docs\Word (RTF) Document API for NET.docx");
Paragraph titleParagraph = wordProcessor.Document.Paragraphs[0];
CharacterProperties characterProperties =
wordProcessor.Document.BeginUpdateCharacters(titleParagraph.Range);
characterProperties.FontName = "Chiller";
characterProperties.FontSize = 16;
wordProcessor.Document.EndUpdateCharacters(characterProperties);
wordProcessor.Document.EmbedFonts = true;
string fileName = /*the path to the OneDrive folder*/
wordProcessor.SaveDocument(fileName, DocumentFormat.OpenXml);
}
When another user downloads this document (and opens it on a machine without the Chiller font installed), the document will be formatted properly:
Spreadsheet Document API, Spreadsheet Controls (WinForms and WPF)
Threaded Comments
With our next major update (v23.1), our Spreadsheet Document API and Spreadsheet components (WinForms and WPF) will ship with APIs to help you manage threaded comments in code.
Use the Worksheet.ThreadedComments property to retrieve a threaded comments collection within a workbook. You can add, edit, reply, and remove threaded comments as requirements dictate. The following code snippet creates a new comment and adds a reply:
var workbook = new Workbook();
workbook.LoadDocument(@"C:\Docs\Comments_template.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
var comments = worksheet.ThreadedComments;
ThreadedComment threadedComment =
comments.Add(worksheet["G16"], "Sales Department",
"The discount was approved by the Sales Director at the meeting on November 5th.");
threadedComment.Resolved = true;
threadedComment.Reply("Nancy Davolio", "Thanks for the hint");
workbook.SaveDocument(@"C:\Docs\Comments.xlsx");
Chart Enhancements
v23.1 ships with the following chart-related enhancements for our Spreadsheet Document API and Spreadsheet Controls (WinForms and WPF).
Custom Fonts in Chart Legends
You can now specify a custom font in a chart legend. Use the Legend.Font property to specify the following format parameters:
- Font name
- Font size
- Bold, italic, or underline formatting
- Text color
Charts legends with custom fonts can now be displayed, printed, and exported (PDF).
Please note that the custom font applied to an individual custom entry in the chart legend will not be displayed. However, the LegendEntry.Font property can be accessed in code, exported in supported formats, and visualized in Microsoft Excel or other spreadsheet applications.
Outlines in Chart Markers
Our Spreadsheet Controls for WinForms and WPF can now display, print, and export (PDF) chart markers with solid outlines.
Linear and Moving Average Trendlines
Trendlines can help analyze data, identify trends, and make predictions. The DevExpress Spreadsheet Control for WinForms and WPF can now display Linear and Moving Average trendlines. Printing and export (PDF) options are also available.
Additional trendline types are not supported in the Early Access Preview. We expect to implement them in the major release (v23.1).