Skip to main content

How to: Specify Chart Sheet Print Options

This example demonstrates how set print options for a chart sheet using properties of the ChartSheetView object returned by the ChartSheet.ActiveView property. This object enables you to set page orientation, margins and paper size.

Use the ChartSheet.PrintOptions property to specify additional print options.

// Create a chart sheet containing a pie chart.
ChartSheet chartSheet = workbook.ChartSheets.Add(ChartType.Pie, worksheet["B2:C7"]);

// Specify print settings.
chartSheet.ActiveView.Orientation = PageOrientation.Landscape;
chartSheet.ActiveView.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.Letter;

// Specify page margins.
workbook.Unit = DevExpress.Office.DocumentUnit.Inch;
Margins pageMargins = chartSheet.ActiveView.Margins;
pageMargins.Left = 0.7F;
pageMargins.Top = 0.75F;
pageMargins.Right = 0.7F;
pageMargins.Bottom = 0.75F;