ChartControl.IsPrintingAvailable Property
Indicates whether or not the chart can be printed and exported.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.UI.dll
NuGet Package: DevExpress.Win.Charts
Declaration
Property Value
Type | Description |
---|---|
Boolean | true if the Chart can be printed; otherwise, false. |
Remarks
The chart can be printed only if the XtraPrinting Library is available on an end-user machine. To print the control, call the ChartControl.Print method.
Note
With the XtraPrinting library, you’re also able to export your chart to various formats (PDF, HTML, etc.). Natively, XtraCharts supports export as an image only. For all other export needs, the XtraPrinting library needs to be installed.
Example
The following example demonstrates how to print a ChartControl, or show its Print Preview. To do this, you should use either the ChartControl.Print or ChartControl.ShowPrintPreview methods.
Note
A chart can be printed and previewed only if the XtraPrinting Library is available. To verify that printing the chart is possible, use the ChartControl.IsPrintingAvailable
property.
When printing a chart, the current print settings will be used to represent a chart. Note that you can access and change these settings via the ChartControl.OptionsPrint property. End-users manually select the printer settings by clicking the Customize toolbar button () in a chart’s preview, and setting the required options in the Printable Component Editor.
using DevExpress.XtraCharts;
// ...
private void ShowChartPreview(ChartControl chart) {
// Check whether the ChartControl can be previewed.
if (!chart.IsPrintingAvailable) {
MessageBox.Show("The 'DevExpress.XtraPrinting.v7.2.dll' is not found", "Error");
return;
}
// Open the Preview window.
chart.ShowPrintPreview();
}
private void PrintChart(ChartControl chart) {
// Check whether the ChartControl can be printed.
if (!chart.IsPrintingAvailable) {
MessageBox.Show("The 'DevExpress.XtraPrinting.v7.2.dll' is not found", "Error");
return;
}
// Print.
chart.Print();
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the IsPrintingAvailable property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.