pub struct ExcelTable {
pub id: u64,
pub name: String,
pub sheet_id: u64,
pub start_row: usize,
pub start_col: usize,
pub end_row: usize,
pub end_col: usize,
pub has_header_row: bool,
pub has_totals_row: bool,
pub columns: Vec<String>,
pub style_name: Option<String>,
}Expand description
A named, rectangular range within a single worksheet, mirroring an Excel
Table (a.k.a. ListObject): a header row, a body of data rows, and an
optional totals row, all with stable per-column names that formulas can
reference via structured references (e.g. Sales[Amount]).
This is a distinct concept from a Sheet: elsewhere in this codebase a
Sheet is informally called a “table” (see Sheet::new’s default name
"table_1"), but an ExcelTable is a sub-range that lives on a sheet,
exactly like a real Excel Table can occupy only part of a worksheet.
Fields§
§id: u64Workbook-unique identifier, stable across renames.
name: StringThe table’s name, as a structured reference spells it. Unique workbook-wide and matched case-insensitively.
sheet_id: u64The sheet this table occupies part of.
start_row: usizeTopmost row of the range, 0-based – the header row when there is one.
start_col: usizeLeftmost column of the range, 0-based.
end_row: usizeBottommost row of the range, 0-based and inclusive – the totals row when there is one.
end_col: usizeRightmost column of the range, 0-based and inclusive.
has_header_row: boolWhether the first row is a header rather than data.
has_totals_row: boolWhether the last row is a totals row rather than data.
columns: Vec<String>Column names, in sheet-column order, one per column in
start_col..=end_col. Kept in sync with the header row’s cell text
(when has_header_row is true) by the CRUD methods in this file.
style_name: Option<String>Visual style theme name (e.g. “TableStyleMedium9”, “TableStyleLight1”, or custom theme)
Implementations§
Source§impl ExcelTable
impl ExcelTable
Sourcepub fn set_style_name(&mut self, style_name: Option<String>)
pub fn set_style_name(&mut self, style_name: Option<String>)
Sets the table’s visual style, or clears it with None.
Sourcepub fn data_start_row(&self) -> usize
pub fn data_start_row(&self) -> usize
First row of the table’s actual data body (excludes the header row).
Sourcepub fn data_end_row(&self) -> usize
pub fn data_end_row(&self) -> usize
Last row of the table’s actual data body (excludes the totals row).
May be less than data_start_row() for a table with no data rows.
Sourcepub fn header_row(&self) -> Option<usize>
pub fn header_row(&self) -> Option<usize>
The header row’s sheet-row index, or None if the table has no
header.
Sourcepub fn totals_row(&self) -> Option<usize>
pub fn totals_row(&self) -> Option<usize>
The totals row’s sheet-row index, or None if the table has no
totals row.
Sourcepub fn local_column_index(&self, name: &str) -> Option<usize>
pub fn local_column_index(&self, name: &str) -> Option<usize>
Index (0-based, relative to the table’s own columns) of the column with the given name, matched case-insensitively as Excel does for structured references.
Trait Implementations§
Source§impl Clone for ExcelTable
impl Clone for ExcelTable
Source§fn clone(&self) -> ExcelTable
fn clone(&self) -> ExcelTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more