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

XlPageSetup.Copies Property

Gets or sets the number of worksheet copies to print.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v19.1.Core.dll

Declaration

public int Copies { get; set; }

Property Value

Type Description
Int32

A positive integer that is a number of copies to print.

If the number of copies is less than 1 or greater than 32767, a System.ArgumentOutOfRangeException will be thrown.

Remarks

To specify page options for a worksheet, set the IXlSheet.PageSetup property to an instance of the XlPageSetup class that controls the page orientation, paper size, scaling options, printing DPI and other settings. For more information on how to adjust page formatting options, refer to the How to: Specify Print Settings article.

Example

Note

A complete sample project is available at https://github.com/DevExpress-Examples/xl-export-api-examples-t253492

// Specify page settings for the worksheet.
sheet.PageSetup = new XlPageSetup();
// Select the paper size.
sheet.PageSetup.PaperKind = System.Drawing.Printing.PaperKind.A4;
// Set the page orientation to Landscape.
sheet.PageSetup.PageOrientation = XlPageOrientation.Landscape;
//  Scale the print area to fit to one page wide.
sheet.PageSetup.FitToPage = true;
sheet.PageSetup.FitToWidth = 1;
sheet.PageSetup.FitToHeight = 0;
//  Print in black and white.
sheet.PageSetup.BlackAndWhite = true;
// Specify the number of copies.
sheet.PageSetup.Copies = 2;
See Also