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

ChartPrinter.Initialize(IPrintingSystem, ILink) Method

Initializes the chart control for document creation before displaying its Print Preview.

Namespace: DevExpress.XtraCharts.Printing

Assembly: DevExpress.XtraCharts.v18.2.dll

Declaration

public virtual void Initialize(
    IPrintingSystem ps,
    ILink link
)

Parameters

Name Type Description
ps IPrintingSystem

An object implementing the IPrintingSystem interface used to print a control.

link ILink

An object implementing the ILink interface which refers to a control.

Example

This example demonstrates how to specify the printing settings of a chart (to fit its size to the page width), using the ChartPrinter class.

using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
using DevExpress.XtraCharts.Printing;
// ...

ChartPrinter cp;

private void button1_Click(object sender, EventArgs e) {
    Link l = new Link(new PrintingSystem());
    l.Landscape = true;
    l.PaperKind = System.Drawing.Printing.PaperKind.A3;
    cp = new ChartPrinter(this.chartControl1);
    cp.Initialize(l.PrintingSystem, l);
    cp.SizeMode = PrintSizeMode.Stretch;
    l.CreateDetailArea += new CreateAreaEventHandler(l_CreateDetailArea);
    l.ShowPreviewDialog();
    cp.Release();
}

void l_CreateDetailArea(object sender, CreateAreaEventArgs e) {
    cp.CreateDetail(e.Graph);
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Initialize(IPrintingSystem, ILink) method.

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.

See Also