Skip to content

Class RangeInfo

Namespace: OfficeOpenXml.FormulaParsing.Ranges
Assembly: EPPlus.dll

EPPlus implementation of the IRangeInfo interface

public class RangeInfo : IRangeInfo, IAddressInfo, IEnumerator<ICellInfo>, IEnumerator, IDisposable, IEnumerable<ICellInfo>, IEnumerable

Inheritance

object ← RangeInfo

Implements

IAddressInfo
IDisposable
IEnumerable
IEnumerable<ICellInfo>
IEnumerator
IEnumerator<ICellInfo>
IRangeInfo

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Constructors

RangeInfo(FormulaRangeAddress)

Constructor

public RangeInfo(FormulaRangeAddress address)

Parameters

address FormulaRangeAddress

RangeInfo(ExcelWorksheet, int, int, int, int, ParsingContext, int)

Constructor

public RangeInfo(ExcelWorksheet ws, int fromRow, int fromCol, int toRow, int toCol, ParsingContext ctx, int extRef = -1)

Parameters

ws ExcelWorksheet

The worksheet

fromRow int

fromCol int

toRow int

toCol int

ctx ParsingContext

Parsing context

extRef int

External reference id

RangeInfo(ExcelWorksheet, ParsingContext)

public RangeInfo(ExcelWorksheet ws, ParsingContext ctx)

Parameters

ws ExcelWorksheet

The worksheet

ctx ParsingContext

Parsing context

RangeInfo(ExcelWorksheet, ExcelAddressBase, ParsingContext)

Constructor

public RangeInfo(ExcelWorksheet ws, ExcelAddressBase address, ParsingContext ctx = null)

Parameters

ws ExcelWorksheet

address ExcelAddressBase

ctx ParsingContext

Parsing context

Properties

Address

The first address of the range

public FormulaRangeAddress Address { get; }

Property Value

FormulaRangeAddress

Addresses

If the address contains more the one address (i.e A1:A2,A4), this array contains all addresses

public FormulaRangeAddress[] Addresses { get; }

Property Value

FormulaRangeAddress[]

Current

Current cell

public ICellInfo Current { get; }

Property Value

ICellInfo

Dimension

Dimension

public FormulaRangeAddress Dimension { get; }

Property Value

FormulaRangeAddress

IsEmpty

Returns true if the range is empty

public bool IsEmpty { get; }

Property Value

bool

IsInMemoryRange

Returns true if the range is an InMemoryRange

public bool IsInMemoryRange { get; }

Property Value

bool

IsMulti

Returns true if more than one cell

public bool IsMulti { get; }

Property Value

bool

IsRef

Returns true if the range represents an invalid reference

public bool IsRef { get; }

Property Value

bool

Size

Size of the range

public RangeDefinition Size { get; }

Property Value

RangeDefinition

Worksheet

The worksheet

public ExcelWorksheet Worksheet { get; }

Property Value

ExcelWorksheet

Methods

Dispose()

Runs at dispose of this instance

public void Dispose()

GetAddressDimensionAdjusted(int)

Get the address adjusted inside the dimension of the worksheet.

public FormulaRangeAddress GetAddressDimensionAdjusted(int index = 0)

Parameters

index int

The index of the address.

Returns

FormulaRangeAddress

The address adjusted within the dimension of the worksheet.

GetEnumerator()

Returns enumerator for cells

public IEnumerator<ICellInfo> GetEnumerator()

Returns

IEnumerator<ICellInfo>

GetNCells()

The total number of cells (including empty) of the range

public int GetNCells()

Returns

int

GetOffset(int, int)

Return value by offset

public object GetOffset(int rowOffset, int colOffset)

Parameters

rowOffset int

colOffset int

Returns

object

GetOffset(int, int, int, int)

Returns a subrange

public IRangeInfo GetOffset(int rowOffsetStart, int colOffsetStart, int rowOffsetEnd, int colOffsetEnd)

Parameters

rowOffsetStart int

colOffsetStart int

rowOffsetEnd int

colOffsetEnd int

Returns

IRangeInfo

GetRangeInfoByValue()

Gets dimension of rang excluding null values

public IRangeInfo GetRangeInfoByValue()

Returns

IRangeInfo

GetValue(int, int)

Returns the cell value by 0-based index

public object GetValue(int row, int col)

Parameters

row int

0-based row index

col int

0-based col index

Returns

object

Cell value

IsHidden(int, int)

Is hidden

public bool IsHidden(int rowOffset, int colOffset)

Parameters

rowOffset int

colOffset int

Returns

bool

MoveNext()

Moves to next cell

public bool MoveNext()

Returns

bool

NextCell()

Moves to next cell

public bool NextCell()

Returns

bool

Reset()

public void Reset()