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: usizeThe number of columns frozen at the left (0 = no column freeze).
frozen_rows: usizeThe number of rows frozen at the top (0 = no row freeze).
Implementations§
Source§impl FreezePane
impl FreezePane
Sourcepub fn new(frozen_columns: usize, frozen_rows: usize) -> FreezePane
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
impl Clone for FreezePane
Source§fn clone(&self) -> FreezePane
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FreezePane
Source§impl Debug for FreezePane
impl Debug for FreezePane
impl Eq for FreezePane
Source§impl PartialEq for FreezePane
impl PartialEq for FreezePane
impl StructuralPartialEq for FreezePane
Auto Trait Implementations§
impl Freeze for FreezePane
impl RefUnwindSafe for FreezePane
impl Send for FreezePane
impl Sync for FreezePane
impl Unpin for FreezePane
impl UnsafeUnpin for FreezePane
impl UnwindSafe for FreezePane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.