ExcelTable
OfficeIMO.Excel
Lightweight object model wrapper for an Excel table.
Inheritance
- object
- ExcelTable
Usage
Explore 15 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 15
- Method ExcelRange.CreateTable
- Method ExcelReportBuilder.AddTable
- Method ExcelReportBuilder.AddTable``1
- Method ColumnComposer.AddTable``1
- Method ExcelSheet.AddTable
- Method ExcelSheet.AddTable``1
- Method ExcelSheet.Table
- Method ExcelTable.AppendDataTable
- Method ExcelTable.ClearTotals
- Method ExcelTable.Rename
- Method ExcelTable.Resize
- Method ExcelTable.SetSchema
- Method ExcelTable.SetStyle
- Method ExcelTable.SetTotals
- Method ExcelTable.SortByColumn
Methods
public ExcelTable AppendDataTable(DataTable table) #Appends rows from a data table to the Excel table.
Parameters
- table System.Data.DataTable
Returns
ExcelTablepublic ExcelRange Column(string headerName, bool includeHeader = false, bool normalizeHeader = true) #Resolves a data-column range in this table by its header text.
Parameters
- headerName string
- includeHeader bool = false
- normalizeHeader bool = true
Returns
ExcelRangepublic ExcelTable Rename(string newName, ExcelTableNameValidationMode validationMode = Strict) #Renames this table and its workbook references.
Parameters
- newName string
- validationMode OfficeIMO.Excel.ExcelTableNameValidationMode = Strict
Returns
ExcelTablepublic ExcelTable Resize(string newRange) #Resizes the table, preserving current column names where possible.
Parameters
- newRange string
Returns
ExcelTablepublic IEnumerable<T> RowsAs<T>(ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams this table's data rows as typed models, using its column schema. Header and totals rows are excluded, including for tables with hidden headers. Enumerate while the owning workbook remains open; unsaved edits are included.
Type Parameters
- T
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Conversion, culture and safety options for reading the values.
- cancellationToken System.Threading.CancellationToken = default
- Cancels table discovery and row enumeration.
Returns
IEnumerable<T>public ExcelTable SetSchema(IReadOnlyList<string> columnNames, string? newRange = null) #Replaces the table's ordered column schema and optionally resizes its range.
Parameters
- columnNames System.Collections.Generic.IReadOnlyList<string>
- newRange string? = null
Returns
ExcelTablepublic ExcelTable SetStyle(ExcelTableStyle style, bool? showFirstColumn = null, bool? showLastColumn = null, bool? showRowStripes = null, bool? showColumnStripes = null) #Applies a built-in table style and optional style flags.
Parameters
- style OfficeIMO.Excel.ExcelTableStyle
- showFirstColumn bool? = null
- showLastColumn bool? = null
- showRowStripes bool? = null
- showColumnStripes bool? = null
Returns
ExcelTablepublic ExcelTable SetTotals(IDictionary<string, ExcelTableTotalsFunction> byHeader) #Applies totals row functions by header name.
Parameters
- byHeader System.Collections.Generic.IDictionary<string, OfficeIMO.Excel.ExcelTableTotalsFunction>
Returns
ExcelTablepublic ExcelTable SortByColumn(int columnOffset, bool ascending = true) #Sorts table rows by a 1-based column offset.
Parameters
- columnOffset int
- ascending bool = true
Returns
ExcelTableInherited Methods
Properties
public string NameOrRange { get; } #Gets the table name, display name, or A1 range used to locate the table.