Table of Contents

Class ExcelTable

Namespace
ExcelReader.Core.Reader
Assembly
ExcelReader.Core.dll

An Excel table (a range formatted with "Format as Table", stored as a ListObject): its name, its position on its sheet and its columns.

public sealed class ExcelTable
Inheritance
ExcelTable
Inherited Members

Remarks

Row and column positions are zero-based and include the header and totals rows.

Properties

ColumnNames

Gets the table's column names, in column order.

public IReadOnlyList<string> ColumnNames { get; }

Property Value

IReadOnlyList<string>

FirstColumn

Gets the zero-based index of the table's first column.

public int FirstColumn { get; }

Property Value

int

FirstRow

Gets the zero-based row of the table's first row: its header row, when it has one.

public int FirstRow { get; }

Property Value

int

HeaderRowCount

Gets the number of header rows: 1, or 0 when the table's header row is turned off.

public int HeaderRowCount { get; }

Property Value

int

LastColumn

Gets the zero-based index of the table's last column.

public int LastColumn { get; }

Property Value

int

LastRow

Gets the zero-based row of the table's last row: its totals row, when it has one.

public int LastRow { get; }

Property Value

int

Name

Gets the table's name, as formulas refer to it (its display name).

public string Name { get; }

Property Value

string

Ref

Gets the table's range in A1 notation, header and totals rows included, such as C4:E8.

public string Ref { get; }

Property Value

string

Sheet

Gets the sheet that holds the table.

public IExcelSheet Sheet { get; }

Property Value

IExcelSheet

StyleName

Gets the name of the table's style, such as TableStyleMedium2, or null when the table has none.

public string? StyleName { get; }

Property Value

string

TotalsRowCount

Gets the number of totals rows: 1 when the table shows a totals row, otherwise 0.

public int TotalsRowCount { get; }

Property Value

int

Methods

AsSheet()

Gets a sheet that reads only this table: its header row first (when it has one), then its data rows without the totals row, each cut to the table's columns.

public IExcelSheet AsSheet()

Returns

IExcelSheet

A sheet bounded to this table.

Remarks

Column indexes stay those of Sheet: a table starting at column C reports its first cell at index 2. The returned sheet reports Sheet's name, index and visibility. Rows absent from the file are skipped, as on any sheet.