Back to Devexpress

WorksheetPrintOptions.FitToWidth Property

officefileapi-devexpress-dot-spreadsheet-dot-worksheetprintoptions-acb830d4.md

latest2.7 KB
Original Source

WorksheetPrintOptions.FitToWidth Property

Gets or sets the number of pages in width to which the worksheet must fit when printed.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
int FitToWidth { get; set; }
vb
Property FitToWidth As Integer

Property Value

TypeDescription
Int32

A positive integer value that specifies the number of horizontal pages to which the worksheet must fit.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to FitToWidth
Worksheet

.PrintOptions .FitToWidth

|

Remarks

To scale the content to fit on a specific number of pages, set the WorksheetPrintOptions.FitToPage property to true and specify the desired number of pages (in width) from the FitToWidth property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FitToWidth property.

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.

spreadsheet-document-api-create-loan-amortization-schedule-within-blazor-server-app/CS/BlazorAppSpreadsheet/Code/DocumentGenerator.cs#L202

csharp
Sheet.PrintOptions.FitToPage = true;
Sheet.PrintOptions.FitToWidth = 1;
Sheet.PrintOptions.FitToHeight = 0;

See Also

WorksheetPrintOptions Interface

WorksheetPrintOptions Members

DevExpress.Spreadsheet Namespace