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>,
pub has_insert_row: bool,
}Expand description
Mirrors an Excel Table (a.k.a. ListObject)
Fields§
§id: u64Workbook-unique identifier
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
style_name: Option<String>Visual style theme name (e.g. “TableStyleMedium9”, “TableStyleLight1”, or custom theme)
has_insert_row: boolWhether the last row of the range is Excel’s insert row placeholder, i.e. the table has zero data rows.
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, excluding the totals row and Excel’s insert-row placeholder.
Sourcepub fn data_row_count(&self) -> usize
pub fn data_row_count(&self) -> usize
How many data rows the table actually has, which is 0 for a table sitting on its insert-row placeholder.
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