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
    https://supportcenter.devexpress.com/ticket/details/T931106
  2. T933994 - How to extract cell references from a parsed formula
    https://supportcenter.devexpress.com/ticket/details/T933994
  3. T933343 - Print or export (to PDF) a pivot table with an empty cache
    https://supportcenter.devexpress.com/ticket/details/T933343

PDF Document API

  1. T942135 - How to extract PDF pages with highlighted text
    https://supportcenter.devexpress.com/ticket/details/T942135

WinForms and WPF Rich Text Editors

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

WinForms PDF Viewer

  1. T937728 - How to enable a custom Save button after a PDF document has been modified
    https://supportcenter.devexpress.com/ticket/details/T937728

WinForms Spreadsheet Control

  1. T932660 - How to show a command shortcut in the Spreadsheet control’s context menu
    https://supportcenter.devexpress.com/ticket/details/T932660
  2. T940978 - How to paste only cell values when cells are copied using the Fill Handle
    https://supportcenter.devexpress.com/ticket/details/T940978

Enhancements

WinForms and WPF Rich Text Editors

  1. T880621 - You can now specify the preferred fonts used for substitution
    https://supportcenter.devexpress.com/ticket/details/T880621

    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 =
             wordProcessor.Options.Behavior.FontSubstitution;
    fontSubstitutionOptions.ComplexScript = "Dubai Medium";
    fontSubstitutionOptions.EastAsia = "SimSum";
  2. T936309 – Our Rich Text Editor includes enhanced Font and Paragraph forms
    https://supportcenter.devexpress.com/ticket/details/T936309

    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
    https://supportcenter.devexpress.com/ticket/details/T936265
  2. T934970 – Enable the classic PivotTable layout
    https://supportcenter.devexpress.com/ticket/details/T934970/

    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
    https://supportcenter.devexpress.com/ticket/details/T932988
  4. T931425 - Use the Axis.AxisType property to replace the category axis with the date axis and vice versa
    https://supportcenter.devexpress.com/ticket/details/T931425

    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
    https://supportcenter.devexpress.com/ticket/details/T949108

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.

Showcase Your Apps on DevExpress.com

Highlight your business app and share your development experiences with the DevExpress community. To include your app in our upcoming App Showcase, please forward an application screenshot to clientservices@devexpress.com and tell us which DevExpress products you currently use within your organization.
1 comment(s)
Christopher Jay
Christopher Jay
Great work and tips.  Thanks.
18 November 2020

Please login or register to post comments.