.NET Spreadsheet – New File Format, Enhanced Printing and PDF Export (v20.1)

This blog post describes all Spreadsheet-related features/capabilities we introduced in our current release cycle (v20.1). Should you have any questions about these features or if you require assistance from a member of our support team, feel free to submit a ticket via the DevExpress Support Center.

New Document Format

We extended the list of supported file formats for our Spreadsheet Document API and Spreadsheet controls (WinForms and WPF). You can now load and save workbooks using the XML Spreadsheet 2003 format.

// Load a document.
workbook.LoadDocument("Document.xml", DocumentFormat.XmlSpreadsheet2003);
// Modify the document.
// ...
// Save the document.
workbook.SaveDocument("DocumentModified.xml", DocumentFormat.XmlSpreadsheet2003);

The new file format is also available to end users via the Open File and Save File dialogs.

PDF Export Enhancements

We created a new PDF export engine and made it the default export option for our Spreadsheet Document API and WinForms Spreadsheet control. The new engine uses DevExpress PDF Document API library to generate PDF files. It renders more precise layouts and has better performance and a smaller memory footprint than its predecessor.

The charts below compare total export time and memory consumption for our new and our legacy PDF export engines. We ran our tests on a set of documents with different content: unwrapped and wrapped (multiline) cell text, conditionally formatted cells, and chart sheets.

To demonstrate PDF export enhancements, we’ve created a video and posted it to our YouTube channel. You can download the video script here: WinForms Spreadsheet - PDF Export Enhancements.

Print-Related Enhancements

Print Layout

We improved row height calculation for printed workbooks in our Spreadsheet Document API and WinForms Spreadsheet control. They now generate a printout that closely mirrors the print output of Microsoft Excel.

Specifically, this enhancement will help you avoid unwanted page breaks that could appear in previous versions of the Spreadsheet control.

Specify What to Print in the Spreadsheet Control (WinForms and WPF)

In a recent minor update (v20.1.4), we introduced a SpreadsheetControl.Options.Print.PrintContent property. This property allows you to specify spreadsheet content to print/display within the Print Preview. You can set this property to one of the following values:

  • SpreadsheetPrintContent.Default - default value (= EntireWorkbook).
  • SpreadsheetPrintContent.EntireWorkbook - prints the entire workbook.
  • SpreadsheetPrintContent.ActiveSheets - prints the active sheet and all selected sheets (if any). To print multiple sheets, hold Ctrl when clicking sheet tabs in the control.
  • SpreadsheetPrintContent.Selection - prints selected cells of the active worksheet. If a chart sheet is active, it is printed completely.
// Specify that the Spreadsheet control should print only selected sheets.
spreadsheetControl1.Options.Print.PrintContent = 

We use this API inside our demo modules for both our WinForms and WPF Spreadsheet controls to replicate Microsoft Excel behavior. We set the PrintContent property to ActiveSheets for most of our demos except for the following modules: Document Properties, Hyperlinks, and all Mail Merge results. The latter demos still print the entire workbook.

Try It Now

If you've installed the DevExpress Demo Center, use the following links to load our new Spreadsheet demos:

Your Feedback Matters

As always, we welcome your thoughts. Please comment below and let us know what you think of these new features.

Once again, should you have technical questions, feel free to contact us via the DevExpress Support Center.

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.