[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Collapse]Charts Suite
   [Collapse]Chart Control
    [Expand]Getting Started
    [Expand]Providing Data
    [Expand]Chart Elements
    [Expand]Appearance Customization
    [Collapse]End-User Features
     [Expand]End-User Capabilities
     [Expand]Tooltip and Crosshair Cursor
      Print and Export
      Chart Designer for End-Users
    [Expand]Design-Time Features
    [Expand]Additional Resources
   [Expand]Chart3D Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Print and Export

The Chart control allows you to print a chart and export it to different file formats using the chart's API, the system's print dialog or the Print Preview form.

This topic describes how to print and export a chart and configure its print options.


You should add a reference to the DevExpress.Xpf.Printing.19.2 assembly to preview, print, and export a chart using the DXPrinting Library.

Expanded Immediately Print a Chart

Call the ChartControlBase.PrintDirect method to use the default printer and page settings to print a chart.

Expanded Show the Default Print Dialog

You can use the ChartControlBase.Print method to change the default print settings before printing.

The code above invokes the standard print dialog. Specify the required settings and click the Print button to print a chart.

Expanded Show the Chart's Print Preview

End users can print/export a chart and customize printing/exporting settings using the Print Preview. The following methods invoke the Print Preview dialog:

The appropriate method Description
ChartControlBase.ShowPrintPreview Creates a document to be printed and invokes the Print Preview with the standard toolbar.
ChartControlBase.ShowPrintPreviewDialog Creates a document to be printed and invokes the Print Preview with the standard toolbar as a modal window.
ChartControlBase.ShowRibbonPrintPreview Creates a document to be printed and invokes the Print Preview with a Ribbon .
ChartControlBase.ShowRibbonPrintPreviewDialog Creates a document to be printed and invokes the Print Preview with a Ribbon as a modal window.

The Print group on the Print Preview's Ribbon contains buttons that allow you to print a chart and configure print settings. To print a chart, click the Print... item.

The Export group on the Print Preview's Ribbon comprises buttons that allow you to export a chart and then save it to a file on the disk or attach the file to an e-mail. To export a chart, click the Export... and select the desired file format.


The images above illustrate the Ribbon Print Preview .

Expanded Export a Chart

You can use API methods to convert a chart to a specific format. The following table lists the file formats and their corresponding export methods:

The exporting format The appropriate method
PDF ChartControlBase.ExportToPdf
HTML ChartControlBase.ExportToHtml
MHT ChartControlBase.ExportToMht
RTF ChartControlBase.ExportToRtf
XLS ChartControlBase.ExportToXls
XLSX ChartControlBase.ExportToXlsx
Image ChartControlBase.ExportToImage
DOCX ChartControlBase.ExportToDocx

You should specify a Chart Control's size using its Width and Height properties when you are exporting a chart that is not added to the Window's Content. Otherwise, the exported document is empty.

Expanded Specify the Chart Print Options

The ChartControlBase.PrintOptions property provides access to the chart's print options. The options specify the printed/exported chart's parameters. Use the ChartPrintOptions.SizeMode property to define how the printed/exported chart should be resized on a page.

The code below demonstrates how to fit the chart's size to the printed page's size.

You can also use a PrintSizeMode value as the ChartControlBase.PrintDirect, ChartControlBase.Print and ExportTo~ (for example, ChartControlBase.ExportToPdf, ChartControlBase.ExportToImage, etc.) method parameter.

Expanded See Also

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