[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Collapse]Spreadsheet Document API
   Product Structure
   Getting Started
  [Expand]Spreadsheet Document
   Supported Formats
  [Expand]Cell Basics
  [Expand]Formulas
   Defined Names
   Data Binding
  [Expand]Pivot Tables
  [Expand]Charts and Graphics
  [Expand]Mail Merge
  [Collapse]Examples
   [Expand]Files
   [Expand]Workbooks
   [Expand]Worksheets
   [Expand]Rows and Columns
   [Expand]Cells
   [Expand]Formulas
   [Expand]Import and Export Data
   [Expand]Data Binding
    Sorting
   [Expand]Mail Merge
    Search
   [Expand]Shapes
   [Expand]Charts
   [Expand]Sparklines
   [Expand]Formatting Cells
   [Expand]Conditional Formatting
   [Expand]Group Data
   [Expand]Filter Data
   [Expand]Tables
   [Expand]Pivot Tables
   [Collapse]Printing
     How to: Print a Workbook
     How to: Specify Print Settings
     How to: Show a Print Preview Form for a Workbook
     How to: Add Headers and Footers to a Worksheet Printout
     How to: Define a Print Area
     How to: Print Titles on a Worksheet
     How to: Use the WPF Chart Rendering Mechanism When Printing or Exporting a Workbook to PDF
   [Expand]Pictures
   [Expand]Protection
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Use the WPF Chart Rendering Mechanism When Printing or Exporting a Workbook to PDF

Charts are converted to images using the WinForms rendering mechanism when you print a workbook containing embedded charts or export it to PDF. However, if you use Spreadsheet Document API in a WPF application, you can use WPF charts when printing or exporting a document to PDF.

Follow the steps below to perform this task:

  1. Add a reference to the DevExpress.Xpf.Spreadsheet.v19.1.dll assembly to your project.
  2. Import the following namespaces into your code:

  3. Register the following services using the DevExpress.Spreadsheet.Workbook.ReplaceService``1 method to substitute the default chart rendering mechanism with the WPF one:

    • DevExpress.Xpf.Spreadsheet.Services.ChartControllerFactoryService
    • DevExpress.XtraSpreadsheet.Services.Implementation.WpfChartImageService
Tip

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T603465.

Is this topic helpful?​​​​​​​