Skip to main content
A newer version of this page is available. .

ChartControl.PrintInitialize Event

Allows you to customize print and export options before the chart is printed or exported.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v19.2.UI.dll

Declaration

public event ChartPrintInitializeEventHandler PrintInitialize

Event Data

The PrintInitialize event's data class is ChartPrintInitializeEventArgs. The following properties provide information specific to this event:

Property Description
Link Gets a PrintableComponentLinkBase object that provides the general functionality to print the Chart Control.
PrintingSystem Returns the Printing System used to create and print a document for the link associated with the Chart Control.

Remarks

You can preview, print and export the chart if the Printing-Exporting library is available and the DevExpress.XtraPrinting.19.2 and DevExpress.Printing.v19.2.Core assemblies are added to the project.

Example

The following code shows how to use the ChartControl.PrintInitialize event to configure the chart’s print options before the chart is previewed.

using DevExpress.XtraPrinting;
//...
chartControl.PrintInitialize += chartControl_PrintInitialize;

private void chartControl_PrintInitialize(object sender, DevExpress.XtraCharts.ChartPrintInitializeEventArgs e) {            
         PrintingSystemBase printingSystem = e.PrintingSystem as PrintingSystemBase;
         printingSystem.PageSettings.Landscape = true;
 }

// Preview the chart in the landscape orientation.
chartControl.ShowPrintPreview();
See Also