Office File API & Office-Inspired Desktop UI Controls – Tips & Tricks (October 2020)

Office-Inspired Products
18 November 2020

As always, we hope you and your family are doing well in this unpredictable time. If we can be of service, please contact us at your convenience.

We’ve compiled this month’s list of interesting support tickets (tickets answered throughout September and October). We hope you find these support tickets of business value as you explore our Office File API and our Office-inspired desktop (WinForms & WPF) UI controls. Should you have any questions, feel free to comment below.

Tips & Tricks

Spreadsheet Document API

  1. T931106 - How to specify a date format for cell values when a document is exported to CSV
  2. T933994 - How to extract cell references from a parsed formula
  3. T933343 - Print or export (to PDF) a pivot table with an empty cache

PDF Document API

  1. T942135 - How to extract PDF pages with highlighted text

WinForms and WPF Rich Text Editors

  1. T937392 – How to find bookmarks located in table cells
  2. T929068 - How to bind the Rich Text Editor to a data field that contains plain and RTF text
  3. T937000 - How to change encoding of HTML text copied from the Rich Text Editor
  4. T937229 - How to show a progress bar during mail merge

WinForms PDF Viewer

  1. T937728 - How to enable a custom Save button after a PDF document has been modified

WinForms Spreadsheet Control

  1. T932660 - How to show a command shortcut in the Spreadsheet control’s context menu
  2. T940978 - How to paste only cell values when cells are copied using the Fill Handle


WinForms and WPF Rich Text Editors

  1. T880621 - You can now specify the preferred fonts used for substitution

    The properties of the FontSubstitutionOptions class allow you to set desired ASCII, Complex Script, High ANSI, and East Asian Unicode fonts used for substitution. When the current font does not include the necessary characters, the preferred font for substitution is used first (to search for these characters).

    The following code sample demonstrates how to specify the preferred font used for substitution:

    FontSubstitutionOptions fontSubstitutionOptions =
    fontSubstitutionOptions.ComplexScript = "Dubai Medium";
    fontSubstitutionOptions.EastAsia = "SimSum";
  2. T936309 – Our Rich Text Editor includes enhanced Font and Paragraph forms

    As you can see below, we redesigned both our Font and Paragraph forms. They now use our DevExpress Layout Control. This helped us address form scaling issues for applications with non-default localization and fonts.

Spreadsheet Document API

  1. T936265 - The SetValueFromText method can now parse currency strings
  2. T934970 – Enable the classic PivotTable layout

    Activate the PivotTable.Behavior.EnableGridDropZones property to display the classic PivotTable layout used in Microsoft Excel 2003. You should also turn on the PivotTable.Cache.RefreshOnLoad option. In this instance, Microsoft Excel will refresh the pivot cache when opening the document and generate the report's layout as needed.

    PivotTable pivotTable = worksheet.PivotTables[0];
    pivotTable.Behavior.EnableGridDropZones = true;
    pivotTable.Cache.RefreshOnLoad = true;
  3. T932988 – You can now skip hidden columns when you export a workbook to CSV or TXT format
  4. T931425 - Use the Axis.AxisType property to replace the category axis with the date axis and vice versa

    The following example creates a chart with the date axis. Set the Axis.Auto property to false before you change the axis type.

    var sheet = spreadsheetControl1.ActiveWorksheet;
    // Create chart.
    var chart = sheet.Charts.Add(ChartType.LineMarker, sheet[0, 0]);
    chart.Series[0].Values = new CellValue[] { 1, 2, 3, 4, 5 };
    chart.Series[0].Arguments = new CellValue[] { 44054, 44055, 44056, 44057, 44060 };
    // Display dates on the category axis.
    chart.PrimaryAxes[0].Auto = false;
    chart.PrimaryAxes[0].AxisType = AxisType.Date;
    chart.PrimaryAxes[0].NumberFormat.IsSourceLinked = false;
    chart.PrimaryAxes[0].NumberFormat.FormatCode = "dd-mmm";

PDF Document API

  1. T949108 – Use the PdfPage.GetPageIndex method to obtain the index of a PDF page

If you’ve come across an interesting support ticket you’d like to share with the rest of the DevExpress developer community, please comment below and include the appropriate link.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.