Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Pivot Grid
  [Expand]Tree List
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Providing Data
   [Expand]Appearance Customization
   [Collapse]End-User Features
    [Expand]Basic End-User Interaction
    [Expand]Crosshair Cursor
     Tooltips
    [Expand]Animation
     Printing and Exporting
     Chart Designer for End-Users
     Integration with a Range Control
     Chart Wizard for End-Users
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Additional Resources
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Printing and Exporting

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

Make sure that your project references the DevExpress.XtraPrinting.17.2 and DevExpress.Printing.v17.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.

MemberDescription
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.

MethodDescription
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.

MethodDescription
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.

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.

PropertyDescription
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

How would you rate this topic?​​​​​​​