[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Expand]Providing Data
   [Expand]Data Representation
   [Expand]Appearance Customization
   [Collapse]End-User Features
    [Expand]Basic End-User Interaction
    [Expand]Tooltip and Crosshair Cursor
     Print and Export
     Hit Information
     Chart Designer for End Users
     Chart Ribbon and Toolbars
     Integration with a Range Control
     Chart Wizard for End-Users
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[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
[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

You can print a chart and export it to multiple file formats.

Make sure that your project references the DevExpress.XtraPrinting.19.2 and DevExpress.Printing.v19.2.Core assemblies to be capable to perform the following tasks.

Expanded Immediately Print a Chart

When you need to immediately print a chart using the default printer, use the following code.

The table below lists API members in use.

Member Description
ChartControl.Print Prints the chart.
ChartControl.IsPrintingAvailable Indicates whether or not the chart is available for printing.

Expanded Print/Export a Chart Using the Print Preview

The chart can be printed/exported from the Print Preview. To display the Print Preview with a toolbox or with a Ribbon, use one of the following methods.

Method Description
ChartControl.ShowPrintPreview Invokes the chart Print Preview with a toolbox.
ChartControl.ShowRibbonPrintPreview Invokes the chart Print Preview with a Ribbon.

The following code demonstrates how to invoke the chart Print Preview with a Ribbon.

To immediately print a chart using the Print Preview, select the Quick Print item.

To show the standard print dialog before printing a chart, select the Print item in the Print Preview.

To export a chart using the Print Preview dialog, select the desired file format in the Export item's drop-down list.

Expanded Export a Chart from Code

You can export a chart to numerous formats using the methods below.

Method Description
ChartControl.ExportToHtml Exports a chart to an HMTL file.
ChartControl.ExportToImage Exports a chart to an image.
ChartControl.ExportToMht Exports a chart to an MHT file.
ChartControl.ExportToPdf Exports a chart to a PDF file.
ChartControl.ExportToXls Exports a chart to an XLS file.
ChartControl.ExportToXlsx Exports a chart to an XLSX file.
ChartControl.ExportToRtf Exports a chart to an RTF file.
ChartControl.ExportToDocx Exports a chart to a DOCX file.
ChartControl.ExportToSvg Exports a chart to an SVG image.

The following code shows how to export a chart to the specified PDF file.

Expanded Configure the Print/Export Options

You can configure chart options before printing/exporting a chart. For this, examine the following code example.

The example above uses the following properties.

Property Description
ChartControl.OptionsPrint Provides access to the chart print options.
ChartOptionsPrint.SizeMode Specifies a chart size mode. To set this property, use the PrintSizeMode enumeration items.
ChartOptionsPrint.ImageFormat Specifes a format of an image to represent a chart in the Print Preview. To set this property, use the PrintImageFormat enumeration items.

Expanded See Also

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