Skip to main content

FreezePane

Struct FreezePane 

Source
pub struct FreezePane {
    pub frozen_columns: usize,
    pub frozen_rows: usize,
}
Expand description

Frozen panes (<pane state="frozen">, CT_Pane). See Sheet.freeze_panes’s doc comment for why only “frozen” (not “split”) panes are modeled.

Fields§

§frozen_columns: usize

The number of columns frozen at the left (0 = no column freeze).

§frozen_rows: usize

The number of rows frozen at the top (0 = no row freeze).

Implementations§

Source§

impl FreezePane

Source

pub fn new(frozen_columns: usize, frozen_rows: usize) -> FreezePane

Creates a freeze-panes setting.

Examples found in repository?
examples/xlsx_structure_and_layout.rs (line 56)
13fn main() -> office_toolkit::Result<()> {
14    let path = output_path("xlsx_structure_and_layout.xlsx");
15
16    let merged_sheet = Sheet::new("Merged cells")
17        .with_row(Row::new().with_text("This title spans three columns"))
18        .with_merged_range("A1:C1");
19
20    let columns_sheet = Sheet::new("Columns")
21        .with_row(
22            Row::new()
23                .with_cell(Cell::text("Wide"))
24                .with_cell(Cell::text("Hidden"))
25                .with_cell(Cell::text("Grouped")),
26        )
27        .with_column_setting(ColumnSetting::new(0).with_width(30.0))
28        .with_column_setting(ColumnSetting::new(1).with_hidden(true))
29        .with_column_setting(
30            ColumnSetting::new(2)
31                .with_outline_level(1)
32                .with_collapsed(false),
33        );
34
35    let rows_sheet = Sheet::new("Rows")
36        .with_row(Row::new().with_text("Normal row"))
37        .with_row(Row::new().with_text("Taller row").with_height(30.0))
38        .with_row(Row::new().with_text("Hidden row").with_hidden(true))
39        .with_row(
40            Row::new()
41                .with_text("Grouped detail row")
42                .with_outline_level(1),
43        );
44
45    let frozen_panes_sheet = Sheet::new("Frozen panes")
46        .with_row(
47            Row::new()
48                .with_cell(Cell::text("Frozen header"))
49                .with_cell(Cell::text("Frozen header")),
50        )
51        .with_row(
52            Row::new()
53                .with_cell(Cell::text("Scrolling data"))
54                .with_cell(Cell::number(1.0)),
55        )
56        .with_freeze_panes(FreezePane::new(1, 1));
57
58    let page_breaks_sheet = Sheet::new("Page breaks")
59        .with_row(Row::new().with_text("Above this row: page break"))
60        .with_row(Row::new().with_text("Below the break"))
61        .with_row_break(1)
62        .with_column_break(0)
63        .with_outline_summary_below(false)
64        .with_outline_summary_right(false);
65
66    let workbook = Workbook::new()
67        .with_sheet(merged_sheet)
68        .with_sheet(columns_sheet)
69        .with_sheet(rows_sheet)
70        .with_sheet(frozen_panes_sheet)
71        .with_sheet(page_breaks_sheet);
72
73    workbook.save_to_file(&path)?;
74    println!("Wrote {}", path.display());
75    Ok(())
76}

Trait Implementations§

Source§

impl Clone for FreezePane

Source§

fn clone(&self) -> FreezePane

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FreezePane

Source§

impl Debug for FreezePane

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for FreezePane

Source§

impl PartialEq for FreezePane

Source§

fn eq(&self, other: &FreezePane) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FreezePane

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.