[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Collapse]Spreadsheet Document API
   Product Structure
   Getting Started
  [Expand]Spreadsheet Document
   Supported Formats
  [Expand]Cell Basics
  [Expand]Formulas
   Defined Names
   Data Binding
  [Expand]Pivot Tables
  [Expand]Charts and Graphics
  [Expand]Mail Merge
  [Collapse]Examples
   [Expand]Files
   [Expand]Workbooks
   [Expand]Worksheets
   [Expand]Rows and Columns
   [Expand]Cells
   [Expand]Formulas
   [Expand]Import and Export Data
   [Expand]Data Binding
    Sorting
   [Expand]Mail Merge
    Search
   [Expand]Shapes
   [Expand]Charts
   [Expand]Sparklines
   [Expand]Formatting Cells
   [Expand]Conditional Formatting
   [Expand]Group Data
   [Expand]Filter Data
   [Expand]Tables
   [Expand]Pivot Tables
   [Collapse]Printing
     How to: Print a Workbook
     How to: Specify Print Settings
     How to: Show a Print Preview Form for a Workbook
     How to: Add Headers and Footers to a Worksheet Printout
     How to: Define a Print Area
     How to: Print Titles on a Worksheet
     How to: Use the WPF Chart Rendering Mechanism When Printing or Exporting a Workbook to PDF
   [Expand]Pictures
   [Expand]Protection
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Specify Print Settings

Use the Worksheet.ActiveView property to specify the following page options:

Property Description
WorksheetView.Margins Defines page margins.
WorksheetView.Orientation Specifies page orientation.
WorksheetView.PaperKind Specifies paper size.

Use the Worksheet.PrintOptions property to configure print options. Print options include the following:

Property Description
WorksheetPrintOptions.FitToPage Indicates whether to scale a worksheet to fit its data within a specified number of pages.
WorksheetPrintOptions.FitToWidth Specifies the number of pages a worksheet should fit within horizontally.
WorksheetPrintOptions.FitToHeight Specifies the number of pages a worksheet should fit within vertically.
WorksheetPrintOptions.Scale Specifies the percentage by which to scale the worksheet content.
WorksheetPrintOptions.PrintGridlines Specifies whether to print worksheet gridlines.
WorksheetPrintOptions.PrintHeadings Specifies whether to print row and column headings.
WorksheetPrintOptions.PrintTitles Allows you to repeat specific rows and columns on the printed pages.
WorksheetPrintOptions.BlackAndWhite Allows you to print a worksheet in black and white.
WorksheetPrintOptions.PageOrder Specifies the order of printed pages.
WorksheetPrintOptions.PageNumbering Allows you to specify the first page number.
WorksheetPrintOptions.CenterHorizontally Specifies whether to center data horizontally on the printed page.
WorksheetPrintOptions.CenterVertically Specifies whether to center data vertically on the printed page.
WorksheetPrintOptions.ErrorsPrintMode Specifies how to print cell errors.
Important

The WorksheetPrintOptions.Draft, WorksheetPrintOptions.NumberOfCopies and WorksheetPrintOptions.CommentsPrintMode options are not supported when you print a workbook from the Spreadsheet component. The Spreadsheet saves these property values to a document, so that you can print the document in Microsoft® Excel® or another spreadsheet application.

Note

A complete sample project is available in the DevExpress-Examples/spreadsheet-document-api-examples-e4339 repository on GitHub.

Is this topic helpful?​​​​​​​