All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

WorkbookLayoutOptions.Dpi Property

Returns or specifies the resolution for document layout generation.

Namespace: DevExpress.XtraSpreadsheet

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

Declaration

public float Dpi { get; set; }
Public Property Dpi As Single

Property Value

Type Description
Single

A DPI value between 96 and 480.

Property Paths

You can access this nested property as listed below:

Object Type Path to Dpi
Workbook
WorkbookOptions
.Layout.Dpi

Remarks

The Spreadsheet Document API uses the current screen DPI value to calculate document layout. This means that documents and printouts generated on systems with different screen DPI can be different (row heights and column widths can vary). On printed pages, these slight variations can push the last rows or columns to the next page (see the image below).

Different DPI settings

You can use the Dpi property to specify a custom DPI value. This option allows you to generate identical documents and printouts on machines with different screen DPIs.

NOTE

The Dpi setting is only available when you use the new layout calculation engine (the SpreadsheetCompatibilityOptions.EnableLegacyLayoutEngine property is false).

Workbook workbook = new Workbook();
// Use 96 DPI to generate a workbook layout.
workbook.Options.Layout.Dpi = 96;

The WorkbookLayoutOptions.DefaultDpi property indicates whether a custom or default (screen) DPI value is used to generate a document layout. Call the WorkbookLayoutOptions.ResetDpi method to use the screen DPI for layout generation.

See Also