We have compiled a list of interesting support tickets answered throughout April and May. We hope you find these support tickets interesting and of business value. Should you have any questions, feel free to comment below.
Tips & Tricks
PDF Document API
- T986216 - How to allow end users to modify printer settings
https://supportcenter.devexpress.com/ticket/details/T986216 - T981703 - How to draw rotated text in a PDF document
https://supportcenter.devexpress.com/ticket/details/T981703
Word Processing Document API
- T992197 - How to obtain hyphenation points for a specific word
https://supportcenter.devexpress.com/ticket/details/T992197 - T992795 - How to check if a document starts with a table
https://supportcenter.devexpress.com/ticket/details/T992795 - T983992 - How to convert URLs to hyperlinks
https://supportcenter.devexpress.com/ticket/details/T983992
Spreadsheet Document API
- T988177 - How to import JSON data into a workbook
https://supportcenter.devexpress.com/ticket/details/T988177 - T987486 - How to find formulas with external references and replace these formulas with calculated values
https://supportcenter.devexpress.com/ticket/details/T987486
ZIP Compression and Archive API
- T984998 - How to update a file in an existing ZIP archive
https://supportcenter.devexpress.com/ticket/details/T984998
WinForms and WPF Rich Text Editors
- T987557 - How to disable spell check for non-English input languages
https://supportcenter.devexpress.com/ticket/details/T987557 - T992330 - How to create an editable field in the Rich Text Editor
https://supportcenter.devexpress.com/ticket/details/T992330 - T983563 – How to highlight document ranges in the Rich Text Editor
https://supportcenter.devexpress.com/ticket/details/T983563
WinForms Spreadsheet Control
- T992528 - How to avoid displaying cell text in black when a dark theme is applied
https://supportcenter.devexpress.com/ticket/details/T992528 - T983081 - How to get a shape located under the mouse cursor
https://supportcenter.devexpress.com/ticket/details/T983081
WinForms PDF Viewer
- T983441 - How to check if a loaded file is password-protected
https://supportcenter.devexpress.com/ticket/details/T983441
Enhancements
WinForms and WPF Rich Text Editors
- T988808 – You can now use an IRichEditAndReviewingPaneCommandFactoryService service to replace built-in commands for the Rich Text Editor with the Reviewing Pane
https://supportcenter.devexpress.com/ticket/details/T988808
Spreadsheet Document API and Spreadsheet Controls (for WinForms and WPF)
T984750 - The PasteSpecial enumeration now includes DataValidations and Hyperlinks members
https://supportcenter.devexpress.com/ticket/details/T984750New enumeration members allow you to specify whether to paste data validation rules and hyperlinks from copied cells into target cells.
The following code sample demonstrates how to paste copied cells without data validation rules:spreadsheetControl1.CopiedRangePasting += (s, e) => { e.PasteSpecialFlags = PasteSpecial.All & ~PasteSpecial.DataValidations; };
T993314 - The CellRange.Select(CellRange) extension method now does not expand cell selection to include merged cells
https://supportcenter.devexpress.com/ticket/details/T993314Use a new CellRange.Select method overload with the expandToMergedCells parameter to specify whether to include merged cells in the selected range.
T998681 – Use a new Worksheet.CopyFrom method overload to specify copy options
https://supportcenter.devexpress.com/ticket/details/T998681Pass a WorksheetCopyOptions class instance to the Worksheet.CopyFrom method to define copy options when you copy data from one worksheet to another. New options allow you to map worksheets from the source workbook to worksheets in the target workbook, specify Paste Special options, use external references for invalid formulas, or replace these formulas with calculated values.
The following example copies all worksheets from one workbook to another:using (Workbook sourceWorkbook = new Workbook()) using (Workbook targetWorkbook = new Workbook()) { targetWorkbook.LoadDocument(@"Documents\Book1.xlsx"); sourceWorkbook.LoadDocument(@"Documents\Book2.xlsx"); // Specify mappings between source worksheets and // target worksheets. Target worksheets will have // the same name as source worksheets. var sheetMappings = SpecifySheetMappings(sourceWorkbook); // Copy all worksheets from a source workbook to target workbook. CopySheetsToWorbook(sourceWorkbook, targetWorkbook, sheetMappings); targetWorkbook.Calculate(); targetWorkbook.SaveDocument("Result.xlsx"); } private static WorksheetCopyOptions SpecifySheetMappings(Workbook sourceWorkbook) { var options = new WorksheetCopyOptions(); foreach (var sheet in sourceWorkbook.Worksheets) { options.SheetMappings.Add(sheet.Name, sheet.Name); } return options; } private static void CopySheetsToWorbook(Workbook sourceWorkbook, Workbook targetWorkbook, WorksheetCopyOptions options) { foreach (var sheet in sourceWorkbook.Worksheets) { string sheetName = sheet.Name; if (!targetWorkbook.Worksheets.Contains(sheetName)) targetWorkbook.Worksheets.Add(sheetName); targetWorkbook.Worksheets[sheetName].CopyFrom(sheet, options); } }
- T983690 – We added a DocumentSettings.CompressImages property to preserve the "Do not compress images in file" option for Excel documents (XLSX, XLSB, XLS)
https://supportcenter.devexpress.com/ticket/details/T983690
WinForms and WPF PDF Viewer
- T995535 – Handle our new ReplyCreated, ReplyChanged, and ReplyDeleted events to determine if a reply was added, changed or removed in the Comments panel
https://supportcenter.devexpress.com/ticket/details/T995535 - T995534 - The AnnotationChanged event now fires when a user edits an annotation in the Comments panel https://supportcenter.devexpress.com/ticket/details/T995534
T989060 – The PDF Viewer now displays a security warning dialog before executing a launch action
https://supportcenter.devexpress.com/ticket/details/T989060T982636 - We implemented a ShellExecuting event that fires when the PDF Viewer executes a launch action (opens a non-PDF file or launches an arbitrary application). You can handle this event to disable our default security warning dialog.
https://supportcenter.devexpress.com/ticket/details/T982636The code sample below disables the warning dialog if the PDF Viewer tries to launch the PdfViewerDemo.exe application:
private void pdfViewer_ShellExecuting(object sender, DevExpress.XtraPdfViewer.PdfShellExecutingEventArgs e) { string demoPath = @" C:\Users\Public\Documents\DevExpress Demos 21.1\Components\WinForms\Bin\PdfViewerDemo.exe"; if (e.FilePath == demoPath) { e.Handled = true; } }
As always, if you’ve come across an interesting support ticket that you’d like to share with the rest of the DevExpress developer community, please comment below and include the appropriate link.