Back to Devexpress

DocumentSettings Interface

officefileapi-devexpress-dot-spreadsheet-00ff3364.md

latest3.3 KB
Original Source

DocumentSettings Interface

Contains workbook options related to formula calculation.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public interface DocumentSettings
vb
Public Interface DocumentSettings

The following members return DocumentSettings objects:

Remarks

To access an object exposing the DocumentSettings interface, use the DocumentSettings property of the IWorkbook or Workbook object.

The notation for WinForms and WPF controls is as follows:

csharp
SpreadsheetControl.Document.DocumentSettings
vb
SpreadsheetControl.Document.DocumentSettings

Example

This example demonstrates how to create formulas using the R1C1 reference style. To do this, switch on the DocumentSettings.R1C1ReferenceStyle option and assign a formula string containing R1C1 cell references to the CellRange.Formula property. To obtain a cell reference in the R1C1 reference style, you can use the CellRange.GetReferenceR1C1 method.

View Example

csharp
// Switch on the R1C1 reference style in a workbook.
workbook.DocumentSettings.R1C1ReferenceStyle = true;

// Specify a formula with relative R1C1 references in cell D2
// to add values contained in cells A2 through A11.
worksheet.Cells["D2"].Formula = "=SUM(RC[-3]:R[9]C[-3])";

// Specify a formula with absolute R1C1 references 
// to add values contained in cells A2 through A11.
worksheet.Cells["D3"].Formula = "=SUM(R2C1:R11C1)";
vb
' Switch on the R1C1 reference style in a workbook.
workbook.DocumentSettings.R1C1ReferenceStyle = True

' Specify a formula with relative R1C1 references in cell D2
' to add values contained in cells A2 through A11.
worksheet.Cells("D2").Formula = "=SUM(RC[-3]:R[9]C[-3])"

' Specify a formula with absolute R1C1 references 
' to add values contained in cells A2 through A11.
worksheet.Cells("D3").Formula = "=SUM(R2C1:R11C1)"

See Also

DocumentSettings Members

DevExpress.Spreadsheet Namespace