This version of the module is deprecated: Use moonbitlang/mbtexcel instead

    #xlsx

    The core package for reading and writing Microsoft Excel (XLSX) files. This package contains all the main types and functionality for manipulating Excel workbooks.

    #Core Types

    #Workbook

    Workbook is the central container that owns all sheets and global state:

    • Sheets: sheets : Array[Worksheet], chart_sheets : Array[ChartSheet]
    • Styles: styles : Array[Style], conditional_styles : Array[Style]
    • Defined names: defined_names : Array[DefinedName]
    • Document properties: core_properties, app_properties, custom_properties
    • Protection: workbook_protection

    #Worksheet

    Worksheet represents a single sheet and contains:

    • Cells: cells : Array[Cell] with row/column coordinates
    • Merged cells: merged_cells : Array[String]
    • Features: tables, charts, images, data validations, conditional formats, etc.
    • Layout: page margins, page layout, header/footer
    • Protection: sheet_protection

    #Cell

    Cell stores cell data:

    • reference : String - Cell reference like "A1"
    • row : Int, col : Int - 1-indexed coordinates
    • value : String - Cell value as string
    • value_type : CellValueType - String, Number, Bool, or Error
    • formula : String? - Optional formula
    • style_id : Int - Index into workbook styles

    #Style

    Style defines cell formatting:

    • font : Font? - Font styling
    • fill : Fill? - Background fill
    • border : Array[Border]? - Cell borders
    • alignment : Alignment? - Text alignment
    • number_format : NumberFormat? - Number formatting
    • protection : Protection? - Cell protection

    #Basic Usage

    #Creating Workbooks

    ///|
    test "create workbook" {
    // Empty workbook
    let wb = Workbook::new()
    inspect(wb.sheets().length(), content="0")

    // Add a sheet
    ignore(wb.add_sheet("Data"))
    debug_inspect(wb.get_sheet_list(), content="[\"Data\"]")
    }

    #Cell Operations

    ///|
    test "cell operations" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Test")

    // Set cell by reference
    sheet.set_cell("A1", "Hello")
    sheet.set_cell("B1", "World")

    // Set cell by row/column (1-indexed)
    sheet.set_cell_rc(2, 1, "Row 2, Col 1")

    // Read cells
    debug_inspect(sheet.get_cell("A1"), content="Some(\"Hello\")")
    debug_inspect(sheet.get_cell_rc(2, 1), content="Some(\"Row 2, Col 1\")")

    // Set typed values
    sheet.set_cell_value("C1", Numeric(42.5))
    sheet.set_cell_value("D1", Bool(true))
    debug_inspect(sheet.get_cell_value_raw("C1"), content="Some(Numeric(42.5))")
    }

    #Row and Column Operations

    ///|
    test "row and column operations" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Grid")

    // Set entire row (1-indexed)
    sheet.set_row(1, ["A", "B", "C", "D"])

    // Set entire column (1-indexed)
    sheet.set_col(1, ["1", "2", "3"])

    // Read row/column
    debug_inspect(sheet.get_row(1), content="[\"1\", \"B\", \"C\", \"D\"]")
    debug_inspect(sheet.get_col(1), content="[\"1\", \"2\", \"3\"]")

    // Row/column dimensions
    inspect(sheet.max_row(), content="3")
    inspect(sheet.max_col(), content="4")
    }

    #Formulas

    ///|
    test "formulas" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Calc")
    sheet.set_cell("A1", "10")
    sheet.set_cell("A2", "20")
    sheet.set_cell("A3", "30")

    // Formula with cached value
    sheet.set_cell_formula("A4", "SUM(A1:A3)", value="60")
    debug_inspect(sheet.get_cell_formula("A4"), content="Some(\"SUM(A1:A3)\")")

    // Calculate formula
    inspect(wb.calc_cell_value("Calc", "A4"), content="60")

    // Array formula
    let opts = FormulaOpts::array("B1:B3")
    sheet.set_cell_formula_opts("B1", "{A1:A3*2}", opts~, value="20")
    }

    #Styling

    #Creating Styles

    ///|
    test "creating styles" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Styled")

    // Create style with font
    let bold_style = Style::font(Font::with_values(bold=true, size=14.0))
    let bold_id = wb.add_style(bold_style)

    // Create style with fill
    let yellow_fill = Style::fill(Fill::solid("FFFF00"))
    let fill_id = wb.add_style(yellow_fill)

    // Combine multiple style elements
    let combined = Style::new()
    .with_font(Font::with_values(bold=true, color="FF0000"))
    .with_fill(Fill::solid("E0E0E0"))
    .with_alignment(Alignment::with_values(horizontal="center", wrap_text=true))
    let combined_id = wb.add_style(combined)

    // Apply style to cell
    sheet.set_cell("A1", "Bold Text")
    sheet.set_cell_style("A1", bold_id)
    sheet.set_cell("A2", "Filled")
    sheet.set_cell_style("A2", fill_id)
    sheet.set_cell("A3", "Combined")
    sheet.set_cell_style("A3", combined_id)
    }

    #Font Options

    ///|
    test "font options" {
    let font = Font::with_values(
    bold=true,
    italic=true,
    size=12.0,
    color="0000FF", // Blue
    underline="single",
    strike=true,
    )
    debug_inspect(font.bold, content="Some(true)")
    debug_inspect(font.size, content="Some(12)")
    }

    #Fill Options

    ///|
    test "fill options" {
    // Solid fill
    let solid = Fill::solid("FF0000") // Red
    debug_inspect(solid.typ, content="Some(\"pattern\")")

    // Pattern fill
    ignore(Fill::pattern(pattern=17, color="00FF00"))

    // Gradient fill
    ignore(Fill::gradient("FF0000", "0000FF", shading=1))
    }

    #Border Options

    ///|
    test "border options" {
    // Create borders for all sides
    let borders = [
    Border::with_values("left", color="000000", style=1),
    Border::with_values("right", color="000000", style=1),
    Border::with_values("top", color="000000", style=1),
    Border::with_values("bottom", color="000000", style=2), // Thicker bottom
    ]
    let style = Style::border(borders)
    debug_inspect(style.border.map(fn(b) { b.length() }), content="Some(4)")
    }

    #Number Formats

    ///|
    test "number formats" {
    // Built-in number format (index 2 = "0.00")
    ignore(Style::builtin_number_format(2))

    // Custom number format
    ignore(Style::number_format("$#,##0.00"))

    // Percentage
    ignore(Style::builtin_number_format(10)) // "0.00%"
    }

    #Data Validation

    ///|
    test "data validation" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Validation")

    // Dropdown list validation
    sheet.add_data_validation_list("A1:A10", ["Option 1", "Option 2", "Option 3"])

    // Range validation with DataValidation struct
    let dv = DataValidation::new(true) // allow_blank=true
    dv.set_sqref("B1:B10")
    dv.set_range(IntValue(1), IntValue(100), Whole, Between)
    dv.set_error(Stop, "Invalid", "Enter 1-100")
    dv.set_input("Hint", "Enter a number between 1 and 100")
    sheet.add_data_validation(dv)
    }

    #Conditional Formatting

    ///|
    test "conditional formatting" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("CF")

    // Create a style for conditional formatting
    let red_fill = Style::fill(Fill::solid("FF0000"))
    let cf_style_id = wb.new_conditional_style(red_fill)

    // Cell value condition
    let cf = ConditionalFormatOptions::new("cell")
    cf.set_criteria(">")
    cf.set_value("100")
    cf.set_format(Some(cf_style_id))
    sheet.set_conditional_format("A1:A100", [cf])
    }

    #Charts

    ///|
    test "charts" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("ChartData")

    // Add data
    sheet.set_row(1, ["Category", "Value"])
    sheet.set_row(2, ["A", "10"])
    sheet.set_row(3, ["B", "20"])
    sheet.set_row(4, ["C", "30"])

    // Create chart series
    let series = ChartSeries::new(
    "ChartData!$B$2:$B$4", // values
    "ChartData!$A$2:$A$4", // categories
    name="Sales",
    )

    // Create chart options
    let chart = ChartOptions::new(Bar)
    chart.series.push(series)
    chart.title = "Sales by Category"
    chart.dimension = ChartDimension::with_values(480, 300)

    // Add chart to sheet
    sheet.add_chart_with_options("E1", chart)
    }

    #Tables

    ///|
    test "tables" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("TableSheet")

    // Add data for table
    sheet.set_row(1, ["Name", "Age", "City"])
    sheet.set_row(2, ["Alice", "30", "NYC"])
    sheet.set_row(3, ["Bob", "25", "LA"])

    // Add table with range reference and column headers
    let table = sheet.add_table(
    "A1:C3", // range reference
    "Table1", // table name
    ["Name", "Age", "City"], // column headers
    display_name="People",
    style_name="TableStyleMedium2",
    show_row_stripes=true,
    )
    inspect(table.name, content="Table1")
    }

    #Merged Cells

    ///|
    test "merged cells" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Merge")

    // Set value first
    sheet.set_cell("A1", "Merged Header")

    // Merge cells
    sheet.merge_cells("A1:D1")

    // Get merged ranges
    debug_inspect(sheet.merged_cells().to_owned(), content="[\"A1:D1\"]")

    // Unmerge
    sheet.unmerge_cells("A1:D1")
    debug_inspect(sheet.merged_cells().to_owned(), content="[]")
    }

    ///|
    test "hyperlinks" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Links")

    // External hyperlink
    sheet.set_cell("A1", "Visit Example")
    sheet.set_cell_hyperlink(
    "A1",
    "https://example.com",
    External,
    display="Example Site",
    tooltip="Click to visit",
    )

    // Internal link to another cell
    sheet.set_cell("A2", "Go to Data")
    sheet.set_cell_hyperlink("A2", "Sheet2!A1", Location)
    }

    #Sheet Operations

    ///|
    test "sheet operations" {
    let wb = Workbook::new()
    ignore(wb.add_sheet("Sheet1"))
    ignore(wb.add_sheet("Sheet2"))
    ignore(wb.add_sheet("Sheet3"))

    // Get sheet by name
    guard wb.sheet("Sheet1") is Some(sheet1) else { return }
    sheet1.set_cell("A1", "OK")

    // Rename sheet
    wb.set_sheet_name("Sheet1", "Data")
    debug_inspect(
    wb.get_sheet_list(),
    content="[\"Data\", \"Sheet2\", \"Sheet3\"]",
    )

    // Hide sheet
    wb.set_sheet_visible("Sheet3", false)
    inspect(wb.get_sheet_visible("Sheet3"), content="false")

    // Delete sheet
    wb.delete_sheet("Sheet2")
    debug_inspect(wb.get_sheet_list(), content="[\"Data\", \"Sheet3\"]")

    // Set active sheet
    wb.set_active_sheet(1)
    inspect(wb.active_sheet_index(), content="1")
    }

    #Row/Column Visibility and Dimensions

    ///|
    test "row column dimensions" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Dims")

    // Set row height
    sheet.set_row_height(1, 30.0)
    debug_inspect(sheet.get_row_height(1), content="Some(30)")

    // Set column width
    sheet.set_col_width(1, 20.0)
    debug_inspect(sheet.get_col_width(1), content="Some(20)")

    // Hide row
    sheet.set_row_visible(2, false)
    inspect(sheet.row_visible(2), content="false")

    // Hide column
    sheet.set_col_visible(3, false)
    inspect(sheet.col_visible(3), content="false")
    }

    #Sheet Protection

    ///|
    test "sheet protection" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Protected")

    // Protect sheet with options
    let opts = SheetProtectionOptions::with_values(
    password="secret",
    format_cells=false, // Prevent formatting
    insert_rows=false, // Prevent inserting rows
    delete_rows=false, // Prevent deleting rows
    )
    sheet.protect_sheet(opts)

    // Check protection
    debug_inspect(
    sheet.sheet_protection().map(fn(p) { p.sheet }),
    content="Some(true)",
    )

    // Unprotect
    sheet.unprotect_sheet(password="secret")
    }

    #Page Layout

    ///|
    test "page layout" {
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Print")

    // Set page margins
    let margins = PageLayoutMarginsOptions::with_values(
    top=1.0,
    bottom=1.0,
    left=0.75,
    right=0.75,
    header=0.5,
    footer=0.5,
    )
    sheet.set_page_margins(Some(margins))

    // Set page layout
    let layout = PageLayoutOptions::with_values(
    orientation="landscape",
    size=9, // A4
    fit_to_width=1,
    fit_to_height=0, // Auto
    )
    sheet.set_page_layout(Some(layout))

    // Set header/footer
    let hf = HeaderFooterOptions::with_values(
    odd_header="&C&\"Arial,Bold\"Report Title",
    odd_footer="&LPage &P of &N&R&D",
    )
    sheet.set_header_footer(Some(hf))
    }

    #Streaming API

    For large files, use the streaming API to write rows in order:

    ///|
    test "stream writer" {
    let wb = Workbook::new()
    ignore(wb.add_sheet("BigData"))

    // Create stream writer
    let sw = wb.new_stream_writer("BigData")

    // Set column widths (must be before writing rows)
    sw.set_col_width(1, 3, 15.0)

    // Write rows in order
    sw.set_row("A1", ["Header1", "Header2", "Header3"])
    sw.set_row("A2", ["Data1", "Data2", "Data3"])
    sw.set_row("A3", ["More", "Data", "Here"])

    // Merge cells
    sw.merge_cell("D1", "F1")

    // Must flush when done
    sw.flush()
    }

    #Reading Workbooks

    ///|
    test "read workbook" {
    // Create and write a workbook
    let wb = Workbook::new()
    let sheet = wb.add_sheet("Test")
    sheet.set_cell("A1", "Hello")
    sheet.set_cell("A2", "World")
    let bytes = write(wb)

    // Read it back
    let loaded = read(bytes)
    debug_inspect(loaded.get_sheet_list(), content="[\"Test\"]")
    debug_inspect(loaded.get_cell("Test", "A1"), content="Some(\"Hello\")")
    debug_inspect(loaded.get_cell("Test", "A2"), content="Some(\"World\")")
    }

    #Embedded Cell Images

    get_pictures returns the images anchored at a cell, including the modern embedded "in-cell" images that are not part of the drawing layer: WPS Office DISPIMG images, rich-value "Place in cell" images, and images inserted by the IMAGE() function. They are read from the xl/richData/* and xl/cellimages.xml parts on open.

    ///|
    let workbook = @mbtexcel.open_file("with_images.xlsx")

    ///|
    let pictures = workbook.get_pictures("Sheet1", "A1")

    #Dates and Times

    Store a ZonedDateTime or Duration directly; the cell is written as an Excel serial number with an appropriate default number format.

    ///|
    test "typed date and duration cells" {
    let wb = Workbook::new()
    ignore(wb.add_sheet("Sheet1"))

    // A date is stored as a whole-number serial (2024-07-03 -> 45476).
    wb.set_cell_time("Sheet1", "A1", @time.date_time(2024, 7, 3))
    debug_inspect(
    wb.get_cell("Sheet1", "A1"),
    content=(
    #|Some("45476")
    ),
    )

    // A duration is stored as a fraction of a day (90 minutes -> 0.0625).
    wb.set_cell_duration("Sheet1", "A2", @time.Duration::of(minutes=90))
    debug_inspect(
    wb.get_cell("Sheet1", "A2"),
    content=(
    #|Some("0.0625")
    ),
    )
    }

    #Package Validation

    validate_ooxml_package runs fast, dependency-free structural checks on serialized workbook bytes — content-type coverage for every part, relationship-target integrity, presence of the required core parts, and well-formed part names. These are the package-level problems that trigger Excel's "we found a problem" repair dialog. An empty result means the package is well-formed.

    ///|
    test "validate package" {
    let wb = Workbook::new()
    ignore(wb.add_sheet("Sheet1"))
    wb.set_cell("Sheet1", "A1", "hello")
    debug_inspect(validate_ooxml_package(write(wb)[:]), content="[]")
    }

    #Error Handling

    All operations that can fail raise XlsxError:

    ///|
    test "error handling" {
    let wb = Workbook::new()

    // Try to get non-existent sheet
    let result : Result[Int, Error] = Ok(wb.get_sheet_index("Missing")) catch {
    e => Err(e)
    }
    debug_inspect(result, content="Ok(-1)")

    // Invalid cell reference
    let sheet = wb.add_sheet("Test")
    let bad_ref : Result[Unit, Error] = Ok(sheet.set_cell("123", "value")) catch {
    e => Err(e)
    }
    guard bad_ref is Err(_) else { return }
    }

    #Cell Reference Utilities

    ///|
    test "cell reference utilities" {
    // Split cell name
    debug_inspect(split_cell_name("AB123"), content="(\"AB\", 123)")

    // Join cell name
    inspect(join_cell_name("AB", 123), content="AB123")

    // Coordinates (1-indexed)
    debug_inspect(cell_name_to_coordinates("C5"), content="(3, 5)")
    inspect(coordinates_to_cell_name(3, 5), content="C5")

    // Absolute references
    inspect(coordinates_to_cell_name(3, 5, abs=true), content="$C$5")

    // Column conversion
    inspect(column_name_to_number("AA"), content="27")
    inspect(column_number_to_name(27), content="AA")
    }

    #Color Utilities

    ///|
    test "color utilities" {
    // RGB to HSL
    let (h, _, _) = rgb_to_hsl(255, 0, 0) // Red
    inspect(h < 1.0, content="true") // Hue near 0

    // HSL to RGB
    let (r, _, _) = hsl_to_rgb(0.0, 1.0, 0.5) // Red
    inspect(r, content="b'\\xFF'") // 255

    // Theme color with tint
    let tinted = theme_color("FF0000", 0.5)
    inspect(tinted.length(), content="8")
    }

    #Defined Names

    ///|
    test "defined names" {
    let wb = Workbook::new()
    ignore(wb.add_sheet("Data"))

    // Create defined name
    let dn = DefinedName::new("SalesRange", "Data!$A$1:$D$100", scope="Data")
    wb.set_defined_name(dn)

    // Get defined names
    let names = wb.get_defined_names()
    inspect(names.length(), content="1")
    inspect(names[0].name, content="SalesRange")
    }

    #Document Properties

    ///|
    test "document properties" {
    let wb = Workbook::new()

    // Set core properties
    let props = CoreProperties::with_values(
    title="Sales Report",
    creator="Finance Team",
    subject="Q4 2024 Sales",
    keywords="sales, quarterly, report",
    description="Quarterly sales report for Q4 2024",
    )
    wb.set_core_properties(props)

    // Read back
    let p = wb.core_properties()
    inspect(p.title, content="Sales Report")
    }

    #API Summary

    #Workbook Methods

    CategoryMethods
    Sheetsadd_sheet, delete_sheet, copy_sheet, sheet, sheets, get_sheet_list, set_sheet_name, set_sheet_visible
    Cellsget_cell, set_cell, get_cell_formula, set_cell_formula, calc_cell_value
    Rows/Colsget_row, set_row, get_col, set_col, insert_rows, remove_row, insert_cols, remove_col
    Stylesadd_style, new_style, get_style, new_conditional_style
    Featuresadd_chart, add_table, add_data_validation, add_pivot_table, add_sparkline, add_image
    Protectionprotect_workbook, unprotect_workbook, protect_sheet, unprotect_sheet
    Propertiescore_properties, app_properties, custom_properties, set_defined_name
    I/Osave, save_as, write_to_buffer

    #Worksheet Methods

    CategoryMethods
    Cellsget_cell, set_cell, get_cell_rc, set_cell_rc, set_cell_value, set_cell_formula, set_cell_style
    Rows/Colsget_row, set_row, get_col, set_col, set_row_height, set_col_width, set_row_visible, set_col_visible
    Mergemerge_cells, unmerge_cells, merged_cells
    Featuresadd_chart, add_table, add_data_validation, add_comment, add_hyperlink, add_image
    Layoutset_page_margins, set_page_layout, set_header_footer, set_panes
    Navigationmax_row, max_col, rows, cols, cells

    XlsxError

    pub suberror XlsxError {
    MissingPart(path~ : String)
    SheetNotFound(name~ : String)
    InvalidSheetName(msg~ : String)
    SheetAlreadyExists(name~ : String)
    InvalidSheetIndex(index~ : Int)
    InvalidSheetOperation(msg~ : String)
    InvalidXml(msg~ : String)
    InvalidBase64(msg~ : String)
    InvalidCellRef(value~ : String)
    InvalidSharedString(index~ : Int)
    InvalidStyleId(index~ : Int)
    InvalidTable(msg~ : String)
    InvalidSparkline(msg~ : String)
    InvalidPivotTable(msg~ : String)
    InvalidVBAProject(msg~ : String)
    InvalidVmlDrawing(msg~ : String)
    InvalidAutoFilter(msg~ : String)
    InvalidDataValidation(msg~ : String)
    InvalidConditionalFormat(msg~ : String)
    InvalidDefinedName(msg~ : String)
    DefinedNameDuplicate(name~ : String)
    DefinedNameScope(name~ : String)
    InvalidPageLayout(msg~ : String)
    InvalidHeaderFooter(msg~ : String)
    InvalidSheetProtection(msg~ : String)
    InvalidWorkbookProperty(msg~ : String)
    InvalidWorkbookProtection(msg~ : String)
    InvalidOptions(msg~ : String)
    InvalidExcelDate(value~ : Double)
    InvalidSheetBackground(msg~ : String)
    InvalidHyperlink(msg~ : String)
    HyperlinkLimitExceeded(limit~ : Int)
    CellTextTooLong(len~ : Int)
    GraphicNameTooLong(len~ : Int, limit~ : Int)
    GraphicAltTextTooLong(len~ : Int, limit~ : Int)
    CommentAlreadyExists(cell~ : String)
    TableNotFound(name~ : String)
    StreamModeConflict(msg~ : String)
    StreamRowOrder(last~ : Int, next~ : Int)
    StreamWriterClosed
    EncryptedPackage
    InvalidEncryptionInfo(msg~ : String)
    InvalidEncryptedPackage(msg~ : String)
    InvalidPassword
    InvalidPasswordLength(len~ : Int)
    UnsupportedEncryption(msg~ : String)
    UnsupportedFeature(msg~ : String)
    } derive(
    Debug
    )

    Alignment

    pub struct Alignment {
    horizontal : String?
    vertical : String?
    wrap_text : Bool?
    text_rotation : Int?
    indent : Int?
    shrink_to_fit : Bool?
    justify_last_line : Bool?
    reading_order : Int?
    relative_indent : Int?
    } derive(Eq,
    Debug
    )

    Text alignment settings for cells.

    Horizontal Values

    • "left", "center", "right", "fill", "justify", "centerContinuous", "distributed"

    Vertical Values

    • "top", "center", "bottom", "justify", "distributed"

    Alignment::with_values

    fn Alignment::with_values(horizontal? : String, vertical? : String, wrap_text? : Bool, text_rotation? : Int, indent? : Int, shrink_to_fit? : Bool, justify_last_line? : Bool, reading_order? : Int, relative_indent? : Int) -> Alignment

    Creates an Alignment with specified values.

    Parameters

    • horizontal: Horizontal alignment ("left", "center", "right", etc.)
    • vertical: Vertical alignment ("top", "center", "bottom", etc.)
    • wrap_text: Enable text wrapping
    • text_rotation: Rotation angle in degrees (0-180, or 255 for vertical)
    • indent: Indentation level
    • shrink_to_fit: Shrink text to fit cell width

    AppProperties

    pub struct AppProperties {
    application : String
    doc_security : Int?
    scale_crop : Bool?
    company : String
    links_up_to_date : Bool?
    hyperlinks_changed : Bool?
    app_version : String
    }

    AppProperties::with_values

    fn AppProperties::with_values(application? : String, doc_security? : Int, scale_crop? : Bool, company? : String, links_up_to_date? : Bool, hyperlinks_changed? : Bool, app_version? : String) -> AppProperties

    AutoFilter

    pub struct AutoFilter {
    range_ref : String
    columns : Array[AutoFilterColumn]
    } derive(
    Debug
    )

    AutoFilterColumn

    pub struct AutoFilterColumn {
    col : Int
    filters : Array[String]?
    custom_filters : AutoFilterCustomFilters?
    } derive(
    Debug
    )

    AutoFilterCustomFilter

    pub struct AutoFilterCustomFilter {
    operator : String
    value : String
    } derive(
    Debug
    )

    AutoFilterCustomFilters

    pub struct AutoFilterCustomFilters {
    and_filter : Bool
    filters : Array[AutoFilterCustomFilter]
    } derive(
    Debug
    )

    AutoFilterOption

    #alias(AutoFilterOptions)
    pub(all) struct AutoFilterOption {
    column : String
    expression : String
    } derive(
    Debug
    )

    Border

    pub struct Border {
    typ : String
    color : String?
    style : Int?
    } derive(Eq,
    Debug
    )

    Border styling for a cell edge.

    Border Types

    • "left", "right", "top", "bottom": Cell edges
    • "diagonalUp", "diagonalDown": Diagonal lines

    Border Styles

    • 0: None
    • 1: Thin
    • 2: Medium
    • 3: Dashed
    • 4: Dotted
    • 5: Thick
    • 6: Double
    • 7: Hair
    • 8: MediumDashed
    • 9: DashDot
    • 10: MediumDashDot
    • 11: DashDotDot
    • 12: MediumDashDotDot
    • 13: SlantDashDot

    Border::with_values

    fn Border::with_values(typ : String, color? : String, style? : Int) -> Border

    Creates a Border with specified values.

    Parameters

    • typ: Border type ("left", "right", "top", "bottom")
    • color: Hex color code
    • style: Border style (1=thin, 2=medium, 5=thick, etc.)

    Example

    let thin_black = Border::with_values("left", color="000000", style=1)

    let thick_red = Border::with_values("bottom", color="FF0000", style=5)

    CalcPropsOptions

    pub struct CalcPropsOptions {
    calc_id : UInt?
    calc_mode : String?
    full_calc_on_load : Bool?
    ref_mode : String?
    iterate : Bool?
    iterate_count : UInt?
    iterate_delta : Double?
    full_precision : Bool?
    calc_completed : Bool?
    calc_on_save : Bool?
    concurrent_calc : Bool?
    concurrent_manual_count : UInt?
    force_full_calc : Bool?
    } derive(Eq,
    Debug
    )

    CalcPropsOptions::new

    CalcPropsOptions::with_values

    fn CalcPropsOptions::with_values(calc_id? : UInt, calc_mode? : String, full_calc_on_load? : Bool, ref_mode? : String, iterate? : Bool, iterate_count? : UInt, iterate_delta? : Double, full_precision? : Bool, calc_completed? : Bool, calc_on_save? : Bool, concurrent_calc? : Bool, concurrent_manual_count? : UInt, force_full_calc? : Bool) -> CalcPropsOptions

    Cell

    pub struct Cell {
    reference : String
    row : Int
    col : Int
    value : String
    value_type : CellValueType
    rich_text : Array[RichTextRun]?
    formula : String?
    formula_type : FormulaType?
    formula_ref : String?
    formula_shared_index : Int?
    style_id : Int
    }

    CellImage

    type CellImage

    A Kingsoft WPS Office embedded cell image, extracted from xl/cellimages.xml and its relationships. The name is the image identifier a DISPIMG formula references; data is the raw media, extension its file extension (with the leading dot, e.g. ".png"), and alt_text the descriptive text from cNvPr@descr.

    CellValue

    pub(all) enum CellValue {
    String(String)
    Numeric(Double)
    Bool(Bool)
    Error(String)
    } derive(
    Debug
    )

    CellValueType

    #alias(CellType)
    type CellValueType derive(Eq,
    Debug
    )

    Chart

    pub struct Chart {
    reference : String
    xml : String
    offset_x : Int
    offset_y : Int
    width_emu : Int
    height_emu : Int
    print_object : Bool
    locked : Bool
    positioning : PicturePositioning
    }

    ChartAxis

    pub(all) struct ChartAxis {
    none : Bool
    drop_lines : Bool
    high_low_lines : Bool
    major_grid_lines : Bool
    minor_grid_lines : Bool
    major_unit : Double
    tick_label_position : ChartTickLabelPositionType
    tick_label_skip : Int
    reverse_order : Bool
    secondary : Bool
    maximum : Double?
    minimum : Double?
    alignment : Alignment
    font : Font
    log_base : Double
    num_fmt : ChartNumFmt
    title : String
    title_rich : Array[RichTextRun]?
    ax_id : Int
    } derive(
    Debug
    )

    ChartComboOptions

    type ChartComboOptions derive(
    Debug
    )

    ChartDashType

    pub(all) enum ChartDashType {
    Unset
    Solid
    Dot
    Dash
    LgDash
    SashDot
    LgDashDot
    LgDashDotDot
    SysDash
    SysDot
    SysDashDot
    SysDashDotDot
    } derive(Eq,
    Debug
    )

    ChartDataLabel

    pub(all) struct ChartDataLabel {
    font : Font
    alignment : Alignment
    fill_color : String
    fill_transparency : Int
    fill : ChartFill?
    } derive(
    Debug
    )

    ChartDataLabelPositionType

    pub(all) enum ChartDataLabelPositionType {
    Center
    Left
    Right
    Top
    Bottom
    BestFit
    InEnd
    OutEnd
    } derive(Eq,
    Debug
    )

    ChartDataPoint

    type ChartDataPoint derive(
    Debug
    )

    ChartDataPoint::new

    fn ChartDataPoint::new(index : Int, fill_color? : String, fill? : ChartFill) -> ChartDataPoint

    ChartDimension

    type ChartDimension derive(
    Debug
    )

    ChartDimension::with_values

    fn ChartDimension::with_values(width : Int, height : Int) -> ChartDimension raise XlsxError

    ChartFill

    pub(all) struct ChartFill {
    typ : String
    pattern : Int
    color : Array[String]
    shading : Int
    transparency : Int
    } derive(
    Debug
    )

    Explicit fill override for a chart element, mirroring Excelize's Fill struct. Only typ == "pattern" with pattern == 1 is acted on (like Go's drawShapeFill): a single color yields a solid fill with optional transparency, and any other color count yields an explicit no-fill. Other configurations are inert, matching Go. shading is accepted for API parity but, like Go's chart path, is not emitted.

    ChartFill::new

    fn ChartFill::new(typ? : String, pattern? : Int, color? : Array[String], shading? : Int, transparency? : Int) -> ChartFill

    ChartLegend

    pub(all) struct ChartLegend {
    position : String
    show_legend_key : Bool
    font : Font?
    } derive(
    Debug
    )

    ChartLine

    pub(all) struct ChartLine {
    typ : ChartLineType
    dash : ChartDashType
    color : String
    transparency : Int
    smooth : Bool
    width : Double
    } derive(
    Debug
    )

    ChartLineType

    pub(all) enum ChartLineType {
    Unset
    Solid
    NoLine
    Automatic
    } derive(Eq,
    Debug
    )

    ChartMarker

    pub(all) struct ChartMarker {
    symbol : String
    size : Int
    fill_color : String
    fill_transparency : Int
    fill : ChartFill?
    border : ChartLine
    } derive(
    Debug
    )

    ChartNumFmt

    type ChartNumFmt derive(
    Debug
    )

    ChartNumFmt::new

    fn ChartNumFmt::new(custom_num_fmt? : String, source_linked? : Bool) -> ChartNumFmt

    ChartOptions

    pub(all) struct ChartOptions {
    typ : ChartType
    series : Array[ChartSeries]
    combo_charts : Array[ChartComboOptions]
    format : GraphicOptions
    dimension : ChartDimension
    legend : ChartLegend
    title : String
    title_rich : Array[RichTextRun]?
    fill_color : String
    fill_transparency : Int
    fill : ChartFill?
    border : ChartLine
    vary_colors : Bool
    x_axis : ChartAxis
    y_axis : ChartAxis
    plot_area : ChartPlotArea
    show_blanks_as : String
    gap_width : Int?
    overlap : Int?
    hole_size : Int?
    bubble_scale : Int?
    } derive(
    Debug
    )

    ChartOptions::add_combo_chart

    fn ChartOptions::add_combo_chart(self : ChartOptions, combo : ChartOptions) -> Unit

    ChartOptions::new

    ChartPlotArea

    pub(all) struct ChartPlotArea {
    show_val : Bool
    show_cat_name : Bool
    show_ser_name : Bool
    show_percent : Bool
    show_leader_lines : Bool
    show_bubble_size : Bool
    show_data_table : Bool
    show_data_table_keys : Bool
    second_plot_values : Int
    num_fmt : ChartNumFmt
    up_bars : ChartUpDownBar
    down_bars : ChartUpDownBar
    fill_color : String
    fill_transparency : Int
    fill : ChartFill?
    } derive(
    Debug
    )

    ChartSeries

    pub(all) struct ChartSeries {
    name : String
    categories : String
    values : String
    bubble_size : String?
    sizes : String
    fill_color : String
    fill_transparency : Int
    fill : ChartFill?
    legend : ChartLegend
    line : ChartLine
    marker : ChartMarker
    data_label : ChartDataLabel
    data_label_position : ChartDataLabelPositionType
    data_point : Array[ChartDataPoint]
    } derive(
    Debug
    )

    ChartSeries::new

    fn ChartSeries::new(categories : String, values : String, name? : String) -> ChartSeries raise XlsxError

    ChartSeries::set_bubble_size

    fn ChartSeries::set_bubble_size(self : ChartSeries, bubble_size : String) -> Unit raise XlsxError

    ChartSheet

    pub struct ChartSheet {
    name : String
    state : SheetState
    chart_xml : String
    }

    ChartSheet::chart_xml

    fn ChartSheet::chart_xml(self : ChartSheet) -> String

    ChartSheet::name

    fn ChartSheet::name(self : ChartSheet) -> String

    ChartSheet::set_state

    fn ChartSheet::set_state(self : ChartSheet, state : SheetState) -> Unit

    ChartSheet::state

    fn ChartSheet::state(self : ChartSheet) -> SheetState

    ChartTickLabelPositionType

    pub(all) enum ChartTickLabelPositionType {
    NextToAxis
    High
    Low
    NoTickLabels
    } derive(
    Debug
    )

    ChartType

    pub(all) enum ChartType {
    Area
    AreaStacked
    AreaPercentStacked
    Area3D
    Area3DStacked
    Area3DPercentStacked
    Bar
    BarStacked
    BarPercentStacked
    Bar3DClustered
    Bar3DStacked
    Bar3DPercentStacked
    Bar3DConeClustered
    Bar3DConeStacked
    Bar3DConePercentStacked
    Bar3DPyramidClustered
    Bar3DPyramidStacked
    Bar3DPyramidPercentStacked
    Bar3DCylinderClustered
    Bar3DCylinderStacked
    Bar3DCylinderPercentStacked
    Col
    ColStacked
    ColPercentStacked
    Col3D
    Col3DClustered
    Col3DStacked
    Col3DPercentStacked
    Col3DCone
    Col3DConeClustered
    Col3DConeStacked
    Col3DConePercentStacked
    Col3DPyramid
    Col3DPyramidClustered
    Col3DPyramidStacked
    Col3DPyramidPercentStacked
    Col3DCylinder
    Col3DCylinderClustered
    Col3DCylinderStacked
    Col3DCylinderPercentStacked
    Doughnut
    Line
    Line3D
    Pie
    Pie3D
    PieOfPie
    BarOfPie
    Radar
    Scatter
    Surface3D
    WireframeSurface3D
    Contour
    WireframeContour
    Bubble
    Bubble3D
    StockHighLowClose
    StockOpenHighLowClose
    } derive(Eq,
    Debug
    )

    ChartUpDownBar

    pub(all) struct ChartUpDownBar {
    fill_color : String
    border : ChartLine
    fill : ChartFill?
    } derive(
    Debug
    )

    ColDimension

    pub struct ColDimension {
    width : Double?
    hidden : Bool
    outline_level : Int
    style_id : Int?
    }

    Cols

    pub struct Cols {
    sheet : Worksheet
    columns : Array[Array[Cell]]
    max_row : Int
    index : Int
    styles : Array[Style]?
    options : Options
    err : XlsxError?
    }

    Cols::col_index

    fn Cols::col_index(self : Cols) -> Int?

    Cols::error

    fn Cols::error(self : Cols) -> XlsxError?

    Cols::next

    fn Cols::next(self : Cols) -> Bool

    Cols::rows

    fn Cols::rows(self : Cols, options? : Options) -> Array[String]

    Comment

    pub(all) struct Comment {
    cell : String
    author : String
    author_id : Int?
    text : String
    paragraph : Array[RichTextRun]
    width : Int?
    height : Int?
    } derive(
    Debug
    )

    ConditionalFormatOptions

    pub(all) struct ConditionalFormatOptions {
    format_type : String
    above_average : Bool
    percent : Bool
    format : Int?
    criteria : String
    value : String
    min_type : String
    mid_type : String
    max_type : String
    min_value : String
    mid_value : String
    max_value : String
    min_color : String
    mid_color : String
    max_color : String
    bar_color : String
    bar_border_color : String
    bar_direction : String
    bar_only : Bool
    bar_solid : Bool
    icon_style : String
    reverse_icons : Bool
    icons_only : Bool
    stop_if_true : Bool
    } derive(
    Debug
    )

    ConditionalFormatOptions::new

    fn ConditionalFormatOptions::new(format_type : String) -> ConditionalFormatOptions

    ConditionalFormatOptions::set_above_average

    fn ConditionalFormatOptions::set_above_average(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_bar_border_color

    fn ConditionalFormatOptions::set_bar_border_color(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_bar_color

    fn ConditionalFormatOptions::set_bar_color(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_bar_direction

    fn ConditionalFormatOptions::set_bar_direction(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_bar_only

    fn ConditionalFormatOptions::set_bar_only(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_bar_solid

    fn ConditionalFormatOptions::set_bar_solid(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_criteria

    fn ConditionalFormatOptions::set_criteria(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_format

    fn ConditionalFormatOptions::set_format(self : ConditionalFormatOptions, value : Int?) -> Unit

    ConditionalFormatOptions::set_icon_style

    fn ConditionalFormatOptions::set_icon_style(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_icons_only

    fn ConditionalFormatOptions::set_icons_only(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_max_color

    fn ConditionalFormatOptions::set_max_color(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_max_type

    fn ConditionalFormatOptions::set_max_type(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_max_value

    fn ConditionalFormatOptions::set_max_value(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_mid_color

    fn ConditionalFormatOptions::set_mid_color(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_mid_type

    fn ConditionalFormatOptions::set_mid_type(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_mid_value

    fn ConditionalFormatOptions::set_mid_value(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_min_color

    fn ConditionalFormatOptions::set_min_color(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_min_type

    fn ConditionalFormatOptions::set_min_type(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_min_value

    fn ConditionalFormatOptions::set_min_value(self : ConditionalFormatOptions, value : String) -> Unit

    ConditionalFormatOptions::set_percent

    fn ConditionalFormatOptions::set_percent(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_reverse_icons

    fn ConditionalFormatOptions::set_reverse_icons(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_stop_if_true

    fn ConditionalFormatOptions::set_stop_if_true(self : ConditionalFormatOptions, value : Bool) -> Unit

    ConditionalFormatOptions::set_value

    fn ConditionalFormatOptions::set_value(self : ConditionalFormatOptions, value : String) -> Unit

    CoreProperties

    pub struct CoreProperties {
    title : String
    subject : String
    creator : String
    keywords : String
    description : String
    last_modified_by : String
    language : String
    identifier : String
    revision : String
    content_status : String
    category : String
    version : String
    created : String
    modified : String
    }

    CoreProperties::with_values

    fn CoreProperties::with_values(title? : String, subject? : String, creator? : String, keywords? : String, description? : String, last_modified_by? : String, language? : String, identifier? : String, revision? : String, content_status? : String, category? : String, version? : String, created? : String, modified? : String) -> CoreProperties

    CustomProperty

    pub struct CustomProperty {
    name : String
    value : CustomPropertyValue?
    } derive(
    Debug
    )

    CustomProperty::new

    fn CustomProperty::new(name : String, value : CustomPropertyValue?) -> CustomProperty

    CustomPropertyValue

    pub(all) enum CustomPropertyValue {
    Integer(Int)
    Float(Double)
    Boolean(Bool)
    Text(String)
    DateTime(String)
    } derive(
    Debug
    )

    DataValidation

    pub struct DataValidation {
    allow_blank : Bool
    error : String?
    error_style : String?
    error_title : String?
    operator : String
    prompt : String?
    prompt_title : String?
    show_drop_down : Bool
    show_error_message : Bool
    show_input_message : Bool
    sqref : String
    validation_type : String
    formula1 : String
    formula2 : String
    } derive(
    Debug
    )

    DataValidation::new

    fn DataValidation::new(allow_blank : Bool) -> DataValidation

    DataValidation::set_drop_list

    fn DataValidation::set_drop_list(self : DataValidation, values : ArrayView[String]) -> Unit raise XlsxError

    DataValidation::set_error

    fn DataValidation::set_error(self : DataValidation, style : DataValidationErrorStyle, title : String, msg : String) -> Unit

    DataValidation::set_input

    fn DataValidation::set_input(self : DataValidation, title : String, msg : String) -> Unit

    DataValidation::set_range

    fn DataValidation::set_range(self : DataValidation, formula1 : DataValidationFormula, formula2 : DataValidationFormula, validation_type : DataValidationType, op : DataValidationOperator) -> Unit raise XlsxError

    DataValidation::set_sqref

    fn DataValidation::set_sqref(self : DataValidation, sqref : String) -> Unit

    DataValidation::set_sqref_drop_list

    fn DataValidation::set_sqref_drop_list(self : DataValidation, sqref : String) -> Unit

    DataValidationErrorStyle

    pub(all) enum DataValidationErrorStyle {
    Stop
    Warning
    Information
    } derive(
    Debug
    )

    DataValidationFormula

    pub(all) enum DataValidationFormula {
    IntValue(Int)
    DoubleValue(Double)
    TextValue(String)
    } derive(
    Debug
    )

    DataValidationOperator

    pub(all) enum DataValidationOperator {
    Between
    Equal
    GreaterThan
    GreaterThanOrEqual
    LessThan
    LessThanOrEqual
    NotBetween
    NotEqual
    } derive(
    Debug
    )

    DataValidationType

    pub(all) enum DataValidationType {
    NoneType
    Custom
    Date
    Decimal
    List
    TextLength
    Time
    Whole
    } derive(
    Debug
    )

    DefinedName

    pub struct DefinedName {
    name : String
    refers_to : String
    scope : String
    comment : String
    } derive(
    Debug
    )

    DefinedName::new

    fn DefinedName::new(name : String, refers_to : String, scope? : String, comment? : String) -> DefinedName

    Fill

    pub struct Fill {
    typ : String?
    pattern : Int?
    shading : Int?
    colors : Array[String]?
    transparency : Int?
    fg_theme : Int?
    fg_indexed : Int?
    fg_tint : Double?
    bg_theme : Int?
    bg_indexed : Int?
    bg_tint : Double?
    } derive(Eq,
    Debug
    )

    Fill (background) styling for cells.

    Supports solid colors, patterns, and gradients.

    Example

    // Solid yellow fill
    let fill = Fill::solid("FFFF00")

    // Gradient fill

    let gradient = Fill::gradient("FF0000", "0000FF", shading=1)

    Fill::gradient

    fn Fill::gradient(color1 : String, color2 : String, shading? : Int, transparency? : Int) -> Fill

    Creates a gradient fill between two colors.

    Parameters

    • color1: Start color (hex code)
    • color2: End color (hex code)
    • shading: Gradient shading variant (0-15)
    • transparency: Transparency percentage (0-100)

    Example

    let gradient = Fill::gradient("FF0000", "0000FF") // Red to blue

    Fill::pattern

    fn Fill::pattern(pattern? : Int, color? : String, transparency? : Int) -> Fill

    Fill::solid

    fn Fill::solid(color : String, transparency? : Int) -> Fill

    Creates a solid color fill.

    Parameters

    • color: Hex color code like "FFFF00" for yellow
    • transparency: Transparency percentage (0-100)

    Example

    let yellow = Fill::solid("FFFF00")

    let semi_transparent = Fill::solid("FF0000", transparency=50)

    Fill::solid_bg_indexed

    fn Fill::solid_bg_indexed(indexed : Int, tint? : Double) -> Fill

    Fill::solid_bg_theme

    fn Fill::solid_bg_theme(theme : Int, tint? : Double) -> Fill

    Fill::solid_indexed

    fn Fill::solid_indexed(indexed : Int, tint? : Double) -> Fill

    Fill::solid_theme

    fn Fill::solid_theme(theme : Int, tint? : Double) -> Fill

    Font

    pub struct Font {
    bold : Bool?
    italic : Bool?
    strike : Bool?
    outline : Bool?
    shadow : Bool?
    condense : Bool?
    extended : Bool?
    underline : String?
    size : Double?
    color : String?
    color_theme : Int?
    color_indexed : Int?
    color_tint : Double?
    charset : Int?
    family_number : Int?
    scheme : String?
    vert_align : String?
    family : String?
    } derive(Eq,
    Debug
    )

    Font styling for cell text.

    All fields are optional; only set fields affect the cell's appearance.

    Example

    let font = Font::with_values(
    bold=true,
    size=12.0,
    color="FF0000", // Red
    underline="single",
    )

    Font::with_values

    fn Font::with_values(bold? : Bool, italic? : Bool, strike? : Bool, outline? : Bool, shadow? : Bool, condense? : Bool, extended? : Bool, underline? : String, size? : Double, color? : String, color_theme? : Int, color_indexed? : Int, color_tint? : Double, charset? : Int, family_number? : Int, scheme? : String, vert_align? : String, family? : String) -> Font

    Creates a new Font with specified values.

    Parameters

    • bold: Bold text
    • italic: Italic text
    • strike: Strikethrough
    • underline: Underline style ("single", "double", "singleAccounting", "doubleAccounting")
    • size: Font size in points
    • color: Hex color code like "FF0000" for red
    • color_theme: Theme color index (0-9)
    • color_tint: Tint value for theme color (-1.0 to 1.0)
    • vert_align: Vertical alignment ("superscript", "subscript")
    • family: Font family name

    FormControl

    pub struct FormControl {
    cell : String
    control_type : String
    text : String
    macro_name : String?
    checked : Bool?
    cell_link : String?
    width : Int?
    height : Int?
    current_val : Int?
    min_val : Int?
    max_val : Int?
    inc_change : Int?
    page_change : Int?
    horizontally : Bool?
    format : GraphicOptions
    paragraph : Array[RichTextRun]
    } derive(
    Debug
    )

    FormControl::new

    fn FormControl::new(cell : String, control_type : String, text? : String) -> FormControl raise XlsxError

    fn FormControl::set_cell_link(self : FormControl, cell_link : StringView) -> Unit raise XlsxError

    FormControl::set_checked

    fn FormControl::set_checked(self : FormControl, checked : Bool) -> Unit

    FormControl::set_current_val

    fn FormControl::set_current_val(self : FormControl, value : Int) -> Unit raise XlsxError

    FormControl::set_format

    fn FormControl::set_format(self : FormControl, format : GraphicOptions) -> Unit

    FormControl::set_height

    fn FormControl::set_height(self : FormControl, height : Int) -> Unit raise XlsxError

    FormControl::set_horizontally

    fn FormControl::set_horizontally(self : FormControl, value : Bool) -> Unit

    FormControl::set_inc_change

    fn FormControl::set_inc_change(self : FormControl, value : Int) -> Unit raise XlsxError

    FormControl::set_macro_name

    fn FormControl::set_macro_name(self : FormControl, value : StringView) -> Unit

    FormControl::set_max_val

    fn FormControl::set_max_val(self : FormControl, value : Int) -> Unit raise XlsxError

    FormControl::set_min_val

    fn FormControl::set_min_val(self : FormControl, value : Int) -> Unit raise XlsxError

    FormControl::set_page_change

    fn FormControl::set_page_change(self : FormControl, value : Int) -> Unit raise XlsxError

    FormControl::set_paragraph

    fn FormControl::set_paragraph(self : FormControl, paragraph : Array[RichTextRun]) -> Unit

    FormControl::set_width

    fn FormControl::set_width(self : FormControl, width : Int) -> Unit raise XlsxError

    FormControlVmlPreset

    type FormControlVmlPreset derive(
    Debug
    )

    FormulaOpts

    pub struct FormulaOpts {
    formula_type : FormulaType?
    range_ref : String?
    } derive(
    Debug
    )

    FormulaOpts::array

    fn FormulaOpts::array(range_ref : String) -> FormulaOpts

    FormulaOpts::shared

    fn FormulaOpts::shared(range_ref : String) -> FormulaOpts

    FormulaOpts::with_values

    fn FormulaOpts::with_values(formula_type? : FormulaType, range_ref? : String) -> FormulaOpts

    FormulaType

    pub(all) enum FormulaType {
    Normal
    Array
    Shared
    DataTable
    } derive(
    Debug
    )

    GraphicOptions

    pub struct GraphicOptions {
    offset_x : Int?
    offset_y : Int?
    scale_x : Double?
    scale_y : Double?
    hyperlink : String?
    hyperlink_type : HyperlinkType?
    name : String?
    alt_text : String?
    lock_aspect_ratio : Bool?
    auto_fit : Bool?
    auto_fit_ignore_aspect : Bool?
    print_object : Bool?
    locked : Bool?
    positioning : PicturePositioning?
    } derive(
    Debug
    )

    GraphicOptions::new

    GraphicOptions::with_values

    fn GraphicOptions::with_values(offset_x? : Int, offset_y? : Int, scale_x? : Double, scale_y? : Double, hyperlink? : String, hyperlink_type? : HyperlinkType, name? : String, alt_text? : String, lock_aspect_ratio? : Bool, auto_fit? : Bool, auto_fit_ignore_aspect? : Bool, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> GraphicOptions

    HeaderFooterImage

    type HeaderFooterImage

    HeaderFooterImageOptions

    pub struct HeaderFooterImageOptions {
    position : HeaderFooterImagePosition
    data : Bytes
    file : String?
    extension : String
    is_footer : Bool
    first_page : Bool
    width : String
    height : String
    } derive(
    Debug
    )

    HeaderFooterImageOptions::from_file

    fn HeaderFooterImageOptions::from_file(position : HeaderFooterImagePosition, file : String, is_footer? : Bool, first_page? : Bool, width? : String, height? : String) -> HeaderFooterImageOptions raise XlsxError

    HeaderFooterImageOptions::new

    fn HeaderFooterImageOptions::new(position : HeaderFooterImagePosition, data : Bytes, extension : String, is_footer? : Bool, first_page? : Bool, width? : String, height? : String) -> HeaderFooterImageOptions

    HeaderFooterImagePosition

    pub(all) enum HeaderFooterImagePosition {
    Left
    Center
    Right
    } derive(Eq,
    Debug
    )

    HeaderFooterOptions

    pub struct HeaderFooterOptions {
    align_with_margins : Bool?
    different_first : Bool
    different_odd_even : Bool
    scale_with_doc : Bool?
    odd_header : String
    odd_footer : String
    even_header : String
    even_footer : String
    first_header : String
    first_footer : String
    } derive(
    Debug
    )

    HeaderFooterOptions::with_values

    fn HeaderFooterOptions::with_values(align_with_margins? : Bool, different_first? : Bool, different_odd_even? : Bool, scale_with_doc? : Bool, odd_header? : String, odd_footer? : String, even_header? : String, even_footer? : String, first_header? : String, first_footer? : String) -> HeaderFooterOptions

    pub struct Hyperlink {
    reference : String
    target : String
    link_type : HyperlinkType
    location : String?
    display : String?
    tooltip : String?
    } derive(
    Debug
    )

    HyperlinkOpts

    pub struct HyperlinkOpts {
    display : String?
    tooltip : String?
    } derive(
    Debug
    )

    HyperlinkOpts::new

    HyperlinkOpts::with_values

    fn HyperlinkOpts::with_values(display? : String, tooltip? : String) -> HyperlinkOpts

    HyperlinkType

    pub(all) enum HyperlinkType {
    External
    Location
    Unset
    } derive(Eq,
    Debug
    )

    IgnoredError

    pub struct IgnoredError {
    sqref : String
    eval_error : Bool
    two_digit_text_year : Bool
    number_stored_as_text : Bool
    formula : Bool
    formula_range : Bool
    unlocked_formula : Bool
    empty_cell_reference : Bool
    list_data_validation : Bool
    calculated_column : Bool
    } derive(Eq,
    Debug
    )

    IgnoredErrorType

    pub(all) enum IgnoredErrorType {
    EvalError
    TwoDigitTextYear
    NumberStoredAsText
    Formula
    FormulaRange
    UnlockedFormula
    EmptyCellReference
    ListDataValidation
    CalculatedColumn
    } derive(Eq,
    Debug
    )

    Image

    #alias(Picture)
    pub struct Image {
    reference : String
    data : Bytes
    extension : String
    content_type : String
    offset_x : Int
    offset_y : Int
    scale_x : Double
    scale_y : Double
    width_emu : Int
    height_emu : Int
    print_object : Bool
    locked : Bool
    hyperlink : String
    hyperlink_type : HyperlinkType
    name : String
    alt_text : String
    lock_aspect_ratio : Bool
    positioning : PicturePositioning
    }

    MergeCell

    pub struct MergeCell {
    range_ref : String
    value : String
    } derive(
    Debug
    )

    MergeCell::get_cell_value

    fn MergeCell::get_cell_value(self : MergeCell) -> String

    MergeCell::get_end_axis

    fn MergeCell::get_end_axis(self : MergeCell) -> String

    MergeCell::get_start_axis

    fn MergeCell::get_start_axis(self : MergeCell) -> String

    NumberFormat

    pub enum NumberFormat {
    Builtin(Int)
    Custom(String)
    } derive(Eq,
    Debug
    )

    Number format specification for cell values.

    Excel supports both built-in formats (by index) and custom format strings.

    Built-in Format IDs

    • 0: General
    • 1: 0
    • 2: 0.00
    • 3: #,##0
    • 4: #,##0.00
    • 9: 0%
    • 10: 0.00%
    • 11: 0.00E+00
    • 12: # ?/?
    • 13: # ??/??
    • 14: mm-dd-yy
    • 15: d-mmm-yy
    • 16: d-mmm
    • 17: mmm-yy
    • 18: h:mm AM/PM
    • 19: h:mm:ss AM/PM
    • 20: h:mm
    • 21: h:mm:ss
    • 22: m/d/yy h:mm

    Options

    pub struct Options {
    max_calc_iterations : UInt
    password : String
    raw_cell_value : Bool
    unzip_size_limit : Int
    unzip_xml_size_limit : Int
    tmp_dir : String
    short_date_pattern : String
    long_date_pattern : String
    long_time_pattern : String
    culture_info : String
    } derive(
    Debug
    )

    Options::new

    fn Options::new() -> Options

    Options::with_values

    fn Options::with_values(max_calc_iterations? : UInt, password? : String, raw_cell_value? : Bool, unzip_size_limit? : Int, unzip_xml_size_limit? : Int, tmp_dir? : String, short_date_pattern? : String, long_date_pattern? : String, long_time_pattern? : String, culture_info? : String) -> Options

    PageBreak

    pub struct PageBreak {
    id : Int
    min : Int
    max : Int
    manual : Bool
    } derive(
    Debug
    )

    PageLayoutMarginsOptions

    pub struct PageLayoutMarginsOptions {
    top : Double?
    bottom : Double?
    left : Double?
    right : Double?
    header : Double?
    footer : Double?
    horizontally : Bool?
    vertically : Bool?
    } derive(
    Debug
    )

    PageLayoutMarginsOptions::with_values

    fn PageLayoutMarginsOptions::with_values(top? : Double, bottom? : Double, left? : Double, right? : Double, header? : Double, footer? : Double, horizontally? : Bool, vertically? : Bool) -> PageLayoutMarginsOptions

    PageLayoutOptions

    pub struct PageLayoutOptions {
    size : Int?
    orientation : String?
    first_page_number : Int?
    adjust_to : Int?
    fit_to_height : Int?
    fit_to_width : Int?
    black_and_white : Bool?
    page_order : String?
    } derive(
    Debug
    )

    PageLayoutOptions::with_values

    fn PageLayoutOptions::with_values(size? : Int, orientation? : String, first_page_number? : Int, adjust_to? : Int, fit_to_height? : Int, fit_to_width? : Int, black_and_white? : Bool, page_order? : String) -> PageLayoutOptions

    Panes

    pub struct Panes {
    freeze : Bool
    split : Bool
    x_split : Int
    y_split : Int
    top_left_cell : String
    active_pane : String
    selection : Array[Selection]
    } derive(
    Debug
    )

    Panes::new

    fn Panes::new() -> Panes

    Panes::with_values

    fn Panes::with_values(freeze? : Bool, split? : Bool, x_split? : Int, y_split? : Int, top_left_cell? : String, active_pane? : String, selection? : Array[Selection]) -> Panes

    PicturePositioning

    pub(all) enum PicturePositioning {
    OneCell
    TwoCell
    Absolute
    } derive(
    Debug
    )

    PivotTable

    pub struct PivotTable {
    name : String
    table_id : Int
    cache_id : Int
    table_xml : String
    cache_definition_xml : String
    cache_records_xml : String?
    }

    PivotTableField

    pub struct PivotTableField {
    data : String
    name : String
    subtotal : String
    num_fmt : Int
    compact : Bool
    outline : Bool
    show_all : Bool
    insert_blank_row : Bool
    default_subtotal : Bool
    } derive(
    Debug
    )

    PivotTableField::new

    fn PivotTableField::new(data : String, name? : String, subtotal? : String, num_fmt? : Int, compact? : Bool, outline? : Bool, show_all? : Bool, insert_blank_row? : Bool, default_subtotal? : Bool) -> PivotTableField raise XlsxError

    PivotTableOptions

    pub(all) struct PivotTableOptions {
    data_range : String
    pivot_table_range : String
    name : String
    rows : Array[PivotTableField]
    columns : Array[PivotTableField]
    data : Array[PivotTableField]
    filter : Array[PivotTableField]
    row_grand_totals : Bool
    col_grand_totals : Bool
    show_drill : Bool
    use_auto_formatting : Bool
    page_over_then_down : Bool
    merge_item : Bool
    classic_layout : Bool
    compact_data : Bool
    show_error : Bool
    show_row_headers : Bool
    show_col_headers : Bool
    show_row_stripes : Bool
    show_col_stripes : Bool
    show_last_column : Bool
    field_print_titles : Bool
    item_print_titles : Bool
    pivot_table_style_name : String
    } derive(
    Debug
    )

    PivotTableOptions::new

    fn PivotTableOptions::new(data_range : String, pivot_table_range : String) -> PivotTableOptions raise XlsxError

    Protection

    pub struct Protection {
    hidden : Bool?
    locked : Bool?
    } derive(Eq,
    Debug
    )

    Protection::with_values

    fn Protection::with_values(hidden? : Bool, locked? : Bool) -> Protection

    RichTextFont

    pub(all) struct RichTextFont {
    bold : Bool
    italic : Bool
    strike : Bool
    outline : Bool
    shadow : Bool
    condense : Bool
    extended : Bool
    underline : String?
    size : Double?
    color : String?
    color_theme : Int?
    color_indexed : Int?
    color_tint : Double?
    charset : Int?
    family_number : Int?
    scheme : String?
    vert_align : String?
    family : String?
    } derive(
    Debug
    )

    RichTextRun

    pub(all) struct RichTextRun {
    text : String
    font : RichTextFont?
    } derive(
    Debug
    )

    RichValueImages

    type RichValueImages

    The parsed xl/richData/* and xl/metadata.xml parts needed to resolve modern Excel embedded cell images ("Place in cell"). Mirrors the chain Excelize's getImageCellRel walks: a cell's vm index selects a value-metadata block, whose record points at a rich value, whose structure names a _rvRel:LocalImageIdentifier value, which indexes richValueRel.xml to a relationship, which resolves to a media part.

    RowCells

    type RowCells

    RowDimension

    pub struct RowDimension {
    height : Double?
    hidden : Bool
    outline_level : Int
    style_id : Int?
    }

    RowOpts

    pub struct RowOpts {
    height : Double
    hidden : Bool
    style_id : Int
    outline_level : Int
    } derive(
    Debug
    )

    RowOpts::with_values

    fn RowOpts::with_values(height? : Double, hidden? : Bool, style_id? : Int, outline_level? : Int) -> RowOpts

    RowStream

    pub struct RowStream {
    cells : Array[Cell]
    index : Int
    }

    RowStream::next

    fn RowStream::next(self : RowStream) -> Array[String]?

    Rows

    pub struct Rows {
    sheet : Worksheet
    entries : Array[RowCells]
    index : Int
    styles : Array[Style]?
    options : Options
    }

    Rows::close

    fn Rows::close(_self : Rows) -> Unit

    Rows::columns

    fn Rows::columns(self : Rows, options? : Options) -> Array[String] raise XlsxError

    Rows::error

    fn Rows::error(_self : Rows) -> XlsxError?

    Rows::get_row_opts

    fn Rows::get_row_opts(self : Rows) -> RowOpts

    Rows::next

    fn Rows::next(self : Rows) -> Bool

    Rows::row_index

    fn Rows::row_index(self : Rows) -> Int?

    Selection

    pub struct Selection {
    sqref : String
    active_cell : String
    pane : String
    } derive(
    Debug
    )

    Selection::with_values

    fn Selection::with_values(sqref? : String, active_cell? : String, pane? : String) -> Selection

    Shape

    pub struct Shape {
    reference : String
    cell : String
    shape_type : String
    macro_alias : String
    macro_name : String
    format : GraphicOptions
    text : String
    paragraph : Array[RichTextRun]
    width : Int
    height : Int
    scale_x : Double
    scale_y : Double
    fill : ShapeFill
    fill_color : String
    fill_transparency : Int
    line : ShapeLine
    line_color : String
    line_width : Double
    name : String
    alt_text : String
    print_object : Bool
    locked : Bool
    positioning : PicturePositioning
    } derive(
    Debug
    )

    Shape::new

    fn Shape::new(reference : String, shape_type : String, macro_name? : String, text? : String, paragraph? : Array[RichTextRun], width? : Int, height? : Int, scale_x? : Double, scale_y? : Double, fill_color? : String, fill_transparency? : Int, line_color? : String, line_width? : Double, name? : String, alt_text? : String, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> Shape raise XlsxError

    ShapeFill

    pub struct ShapeFill {
    color : String?
    transparency : Int?
    } derive(
    Debug
    )

    ShapeFill::with_values

    fn ShapeFill::with_values(color? : String, transparency? : Int) -> ShapeFill raise XlsxError

    ShapeLine

    pub struct ShapeLine {
    color : String?
    width : Double?
    } derive(
    Debug
    )

    ShapeLine::with_values

    fn ShapeLine::with_values(color? : String, width? : Double) -> ShapeLine

    SheetBackground

    pub struct SheetBackground {
    data : Bytes
    extension : String
    content_type : String
    } derive(
    Debug
    )

    SheetEntry

    type SheetEntry derive(
    Debug
    )

    SheetPane

    type SheetPane derive(
    Debug
    )

    SheetPropsOptions

    pub struct SheetPropsOptions {
    code_name : String?
    enable_format_conditions_calculation : Bool?
    published : Bool?
    auto_page_breaks : Bool?
    fit_to_page : Bool?
    tab_color_indexed : Int?
    tab_color_rgb : String?
    tab_color_theme : Int?
    tab_color_tint : Double?
    outline_summary_below : Bool?
    outline_summary_right : Bool?
    base_col_width : Int?
    default_col_width : Double?
    default_row_height : Double?
    custom_height : Bool?
    zero_height : Bool?
    thick_top : Bool?
    thick_bottom : Bool?
    } derive(
    Debug
    )

    SheetPropsOptions::with_values

    fn SheetPropsOptions::with_values(code_name? : String, enable_format_conditions_calculation? : Bool, published? : Bool, auto_page_breaks? : Bool, fit_to_page? : Bool, tab_color_indexed? : Int, tab_color_rgb? : String, tab_color_theme? : Int, tab_color_tint? : Double, outline_summary_below? : Bool, outline_summary_right? : Bool, base_col_width? : Int, default_col_width? : Double, default_row_height? : Double, custom_height? : Bool, zero_height? : Bool, thick_top? : Bool, thick_bottom? : Bool) -> SheetPropsOptions

    SheetProtection

    pub struct SheetProtection {
    algorithm_name : String
    password : String
    hash_value : String
    salt_value : String
    spin_count : Int
    sheet : Bool
    objects : Bool
    scenarios : Bool
    format_cells : Bool
    format_columns : Bool
    format_rows : Bool
    insert_columns : Bool
    insert_rows : Bool
    insert_hyperlinks : Bool
    delete_columns : Bool
    delete_rows : Bool
    select_locked_cells : Bool
    sort : Bool
    auto_filter : Bool
    pivot_tables : Bool
    select_unlocked_cells : Bool
    } derive(
    Debug
    )

    SheetProtectionOptions

    pub struct SheetProtectionOptions {
    algorithm_name : String
    password : String
    auto_filter : Bool
    delete_columns : Bool
    delete_rows : Bool
    edit_objects : Bool
    edit_scenarios : Bool
    format_cells : Bool
    format_columns : Bool
    format_rows : Bool
    insert_columns : Bool
    insert_hyperlinks : Bool
    insert_rows : Bool
    pivot_tables : Bool
    select_locked_cells : Bool
    select_unlocked_cells : Bool
    sort : Bool
    } derive(
    Debug
    )

    SheetProtectionOptions::new

    SheetProtectionOptions::with_values

    fn SheetProtectionOptions::with_values(algorithm_name? : String, password? : String, auto_filter? : Bool, delete_columns? : Bool, delete_rows? : Bool, edit_objects? : Bool, edit_scenarios? : Bool, format_cells? : Bool, format_columns? : Bool, format_rows? : Bool, insert_columns? : Bool, insert_hyperlinks? : Bool, insert_rows? : Bool, pivot_tables? : Bool, select_locked_cells? : Bool, select_unlocked_cells? : Bool, sort? : Bool) -> SheetProtectionOptions

    SheetState

    pub enum SheetState {
    Visible
    Hidden
    VeryHidden
    } derive(Eq,
    Debug
    )

    SheetView

    type SheetView derive(
    Debug
    )

    SheetViewOptions

    #alias(ViewOptions)
    pub struct SheetViewOptions {
    default_grid_color : Bool?
    right_to_left : Bool?
    show_formulas : Bool?
    show_grid_lines : Bool?
    show_row_col_headers : Bool?
    show_ruler : Bool?
    show_zeros : Bool?
    top_left_cell : String?
    view : String?
    zoom_scale : Double?
    } derive(
    Debug
    )

    SheetViewOptions::new

    SheetViewOptions::with_values

    fn SheetViewOptions::with_values(default_grid_color? : Bool, right_to_left? : Bool, show_formulas? : Bool, show_grid_lines? : Bool, show_row_col_headers? : Bool, show_ruler? : Bool, show_zeros? : Bool, top_left_cell? : String, view? : String, zoom_scale? : Double) -> SheetViewOptions

    Slicer

    pub struct Slicer {
    name : String
    cache : String
    source_name : String
    cell : String
    table_sheet : String
    table_name : String
    caption : String
    macro_name : String
    width : Int
    height : Int
    display_header : Bool?
    item_desc : Bool
    format : GraphicOptions
    } derive(
    Debug
    )

    Slicer::new

    fn Slicer::new(name : String) -> Slicer raise XlsxError

    SlicerOptions

    type SlicerOptions derive(
    Debug
    )

    SlicerOptions::new

    fn SlicerOptions::new(name : String, cell : String, table_sheet : String, table_name : String) -> SlicerOptions raise XlsxError

    SlicerOptions::set_caption

    fn SlicerOptions::set_caption(self : SlicerOptions, caption : String) -> Unit

    SlicerOptions::set_display_header

    fn SlicerOptions::set_display_header(self : SlicerOptions, display_header : Bool?) -> Unit

    SlicerOptions::set_format

    fn SlicerOptions::set_format(self : SlicerOptions, format : GraphicOptions) -> Unit

    SlicerOptions::set_item_desc

    fn SlicerOptions::set_item_desc(self : SlicerOptions, item_desc : Bool) -> Unit

    SlicerOptions::set_macro_name

    fn SlicerOptions::set_macro_name(self : SlicerOptions, macro_name : String) -> Unit

    SlicerOptions::set_size

    fn SlicerOptions::set_size(self : SlicerOptions, width : Int, height : Int) -> Unit raise XlsxError

    Sparkline

    pub struct Sparkline {
    range_ref : String
    location : String
    }

    SparklineColor

    pub struct SparklineColor {
    rgb : String?
    theme : Int?
    tint : Double?
    } derive(
    Debug
    )

    SparklineGroup

    pub struct SparklineGroup {
    sparkline_type : SparklineType
    sparklines : Array[Sparkline]
    options : SparklineGroupOptions
    }

    SparklineGroupOptions

    pub struct SparklineGroupOptions {
    display_empty_cells_as : String
    date_axis : Bool
    line_weight : Double?
    manual_max : Int?
    manual_min : Int?
    markers : Bool
    high : Bool
    low : Bool
    first : Bool
    last : Bool
    negative : Bool
    display_x_axis : Bool
    display_hidden : Bool
    right_to_left : Bool
    color_series : SparklineColor?
    color_negative : SparklineColor?
    color_axis : SparklineColor?
    color_markers : SparklineColor?
    color_first : SparklineColor?
    color_last : SparklineColor?
    color_high : SparklineColor?
    color_low : SparklineColor?
    } derive(
    Debug
    )

    SparklineOptions

    pub struct SparklineOptions {
    locations : Array[String]
    ranges : Array[String]
    location : Array[String]
    range : Array[String]
    sparkline_type : SparklineType
    style : Int
    weight : Double?
    date_axis : Bool
    markers : Bool
    high : Bool
    low : Bool
    first : Bool
    last : Bool
    negative : Bool
    axis : Bool
    hidden : Bool
    reverse : Bool
    series_color : String?
    negative_color : String?
    markers_color : String?
    first_color : String?
    last_color : String?
    high_color : String?
    low_color : String?
    max : Int
    cust_max : Int
    min : Int
    cust_min : Int
    manual_max : Int?
    manual_min : Int?
    empty_cells : String?
    } derive(
    Debug
    )

    SparklineOptions::clear_manual_max

    fn SparklineOptions::clear_manual_max(self : SparklineOptions) -> Unit

    SparklineOptions::clear_manual_min

    fn SparklineOptions::clear_manual_min(self : SparklineOptions) -> Unit

    SparklineOptions::new

    fn SparklineOptions::new(locations : ArrayView[String], ranges : ArrayView[String]) -> SparklineOptions raise XlsxError

    SparklineOptions::set_axis

    fn SparklineOptions::set_axis(self : SparklineOptions, axis : Bool) -> Unit

    SparklineOptions::set_date_axis

    fn SparklineOptions::set_date_axis(self : SparklineOptions, date_axis : Bool) -> Unit

    SparklineOptions::set_empty_cells

    fn SparklineOptions::set_empty_cells(self : SparklineOptions, mode : StringView) -> Unit raise XlsxError

    SparklineOptions::set_first_color

    fn SparklineOptions::set_first_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_hidden

    fn SparklineOptions::set_hidden(self : SparklineOptions, hidden : Bool) -> Unit

    SparklineOptions::set_high

    fn SparklineOptions::set_high(self : SparklineOptions, high : Bool) -> Unit

    SparklineOptions::set_high_color

    fn SparklineOptions::set_high_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_last_color

    fn SparklineOptions::set_last_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_low

    fn SparklineOptions::set_low(self : SparklineOptions, low : Bool) -> Unit

    SparklineOptions::set_low_color

    fn SparklineOptions::set_low_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_manual_max

    fn SparklineOptions::set_manual_max(self : SparklineOptions, max : Int) -> Unit

    SparklineOptions::set_manual_min

    fn SparklineOptions::set_manual_min(self : SparklineOptions, min : Int) -> Unit

    SparklineOptions::set_markers

    fn SparklineOptions::set_markers(self : SparklineOptions, markers : Bool) -> Unit

    SparklineOptions::set_markers_color

    fn SparklineOptions::set_markers_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_negative_color

    fn SparklineOptions::set_negative_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_reverse

    fn SparklineOptions::set_reverse(self : SparklineOptions, reverse : Bool) -> Unit

    SparklineOptions::set_series_color

    fn SparklineOptions::set_series_color(self : SparklineOptions, value : String) -> Unit

    SparklineOptions::set_style

    fn SparklineOptions::set_style(self : SparklineOptions, style : Int) -> Unit

    SparklineOptions::set_type

    fn SparklineOptions::set_type(self : SparklineOptions, sparkline_type : SparklineType) -> Unit

    SparklineOptions::set_weight

    fn SparklineOptions::set_weight(self : SparklineOptions, weight : Double) -> Unit raise XlsxError

    SparklineType

    pub(all) enum SparklineType {
    Line
    Column
    WinLoss
    } derive(Eq,
    Debug
    )

    StreamCell

    pub struct StreamCell {
    value : String
    value_type : CellValueType
    rich_text : Array[RichTextRun]?
    formula : String?
    style_id : Int
    // private fields
    }

    StreamCell::new

    fn StreamCell::new(value : String, formula? : String, style_id? : Int) -> StreamCell

    StreamCell::new_blank

    fn StreamCell::new_blank() -> StreamCell

    A blank slot in a stream row: the column position advances but no cell element is written, mirroring a nil value in Go's stream SetRow.

    StreamCell::new_rich_text

    fn StreamCell::new_rich_text(runs : ArrayView[RichTextRun], formula? : String, style_id? : Int) -> StreamCell raise XlsxError

    StreamCell::new_value

    fn StreamCell::new_value(value : CellValue, formula? : String, style_id? : Int) -> StreamCell

    StreamState

    type StreamState derive(Eq)

    StreamWriter

    pub struct StreamWriter {
    sheet : Worksheet
    sheet_id : Int
    last_row : Int
    styles : Array[Style]
    closed : Bool
    // private fields
    }

    StreamWriter::add_table

    fn StreamWriter::add_table(self : StreamWriter, range_ref : String, name : String, columns : ArrayView[String], display_name? : String, style_name? : String, show_first_column? : Bool, show_last_column? : Bool, show_row_stripes? : Bool, show_column_stripes? : Bool, show_header_row? : Bool) -> Table raise XlsxError

    StreamWriter::flush

    fn StreamWriter::flush(self : StreamWriter) -> Unit raise XlsxError

    StreamWriter::insert_page_break

    fn StreamWriter::insert_page_break(self : StreamWriter, cell : StringView) -> Unit raise XlsxError

    StreamWriter::merge_cell

    fn StreamWriter::merge_cell(self : StreamWriter, top_left : StringView, bottom_right : StringView) -> Unit raise XlsxError

    StreamWriter::new_duration_cell

    fn StreamWriter::new_duration_cell(self : StreamWriter, value :
    Duration
    , formula? : String, style_id? : Int) -> StreamCell

    Builds a stream cell holding a duration as a fraction of a day, mirroring the Go stream writer's time.Duration handling: the value is stored numerically and no default style is applied. The serial keeps full double precision where Go formats through float32.

    StreamWriter::new_time_cell

    fn StreamWriter::new_time_cell(self : StreamWriter, value :
    ZonedDateTime
    , formula? : String, style_id? : Int) -> StreamCell

    Builds a stream cell holding a datetime, mirroring the Go stream writer's time.Time handling: the value becomes an Excel date serial (reading the workbook's current date-1904 setting) and, when no explicit style_id is given and no row or column style applies at write time, the cell receives the default date/time format (numFmt 22, registered once per stream writer). Pre-epoch datetimes are stored as ISO-8601 text without a default style, like Go's RFC3339 fallback.

    StreamWriter::set_col_outline_level

    fn StreamWriter::set_col_outline_level(self : StreamWriter, col : Int, level : Int) -> Unit raise XlsxError

    StreamWriter::set_col_style

    fn StreamWriter::set_col_style(self : StreamWriter, start_col : Int, end_col : Int, style_id : Int) -> Unit raise XlsxError

    StreamWriter::set_col_visible

    fn StreamWriter::set_col_visible(self : StreamWriter, start_col : Int, end_col : Int, visible : Bool) -> Unit raise XlsxError

    StreamWriter::set_col_width

    fn StreamWriter::set_col_width(self : StreamWriter, start_col : Int, end_col : Int, width : Double) -> Unit raise XlsxError

    StreamWriter::set_panes

    fn StreamWriter::set_panes(self : StreamWriter, panes : Panes) -> Unit raise XlsxError

    StreamWriter::set_row

    fn StreamWriter::set_row(self : StreamWriter, start_ref : String, values : ArrayView[String], row_opts? : RowOpts) -> Unit raise XlsxError

    StreamWriter::set_row_cells

    fn StreamWriter::set_row_cells(self : StreamWriter, start_ref : String, values : ArrayView[StreamCell], row_opts? : RowOpts) -> Unit raise XlsxError

    StreamWriter::sheet_id

    fn StreamWriter::sheet_id(self : StreamWriter) -> Int

    Style

    pub struct Style {
    number_format : NumberFormat?
    num_fmt : Int?
    decimal_places : Int?
    custom_num_fmt : String?
    neg_red : Bool?
    font : Font?
    fill : Fill?
    border : Array[Border]?
    protection : Protection?
    alignment : Alignment?
    } derive(Eq,
    Debug
    )

    Complete cell style specification.

    A Style combines font, fill, border, alignment, number format, and protection settings. Styles are registered with a workbook and referenced by ID in cells.

    Example

    // Create a style with multiple elements
    let style = Style::new()
    .with_font(Font::with_values(bold=true, size=12.0))
    .with_fill(Fill::solid("FFFF00"))
    .with_alignment(Alignment::with_values(horizontal="center"))

    // Register with workbook and apply to cell
    let style_id = workbook.add_style(style)
    sheet.set_cell_style("A1", style_id)

    Style::alignment

    fn Style::alignment(alignment : Alignment) -> Style

    Style::border

    fn Style::border(border : Array[Border]) -> Style

    Creates a Style with only border settings.

    Example

    let box_border = Style::border([
    Border::with_values("left", color="000000", style=1),
    Border::with_values("right", color="000000", style=1),
    Border::with_values("top", color="000000", style=1),
    Border::with_values("bottom", color="000000", style=1),
    ])

    Style::builtin_number_format

    fn Style::builtin_number_format(id : Int) -> Style

    Creates a Style with a built-in number format.

    Parameters

    • id: Built-in format ID (see NumberFormat for common IDs)

    Common IDs

    • 1: 0
    • 2: 0.00
    • 3: #,##0
    • 4: #,##0.00
    • 9: 0%
    • 10: 0.00%
    • 14: mm-dd-yy

    Style::excelize_currency_num_fmt

    fn Style::excelize_currency_num_fmt(num_fmt : Int, decimal_places? : Int, neg_red? : Bool) -> Style raise XlsxError

    Style::excelize_custom_num_fmt

    fn Style::excelize_custom_num_fmt(format_code : StringView) -> Style raise XlsxError

    Style::fill

    fn Style::fill(fill : Fill) -> Style

    Creates a Style with only fill settings.

    Style::font

    fn Style::font(font : Font) -> Style

    Creates a Style with only font settings.

    Style::new

    fn Style::new() -> Style

    Creates a new empty Style with all fields set to None.

    Style::number_format

    fn Style::number_format(format_code : String) -> Style

    Creates a Style with a custom number format.

    Parameters

    • format_code: Excel number format string like "#,##0.00", "0%", "yyyy-mm-dd"

    Example

    let currency = Style::number_format("$#,##0.00")

    let percent = Style::number_format("0.0%")

    let date = Style::number_format("yyyy-mm-dd")

    Style::protection

    fn Style::protection(protection : Protection) -> Style

    Creates a Style with only protection settings.

    Style::with_alignment

    fn Style::with_alignment(self : Style, alignment : Alignment) -> Style

    Style::with_fill

    fn Style::with_fill(self : Style, fill : Fill) -> Style

    Returns a new Style with fill settings added/replaced.

    Style::with_font

    fn Style::with_font(self : Style, font : Font) -> Style

    Returns a new Style with font settings added/replaced.

    Table

    pub struct Table {
    id : Int
    name : String
    display_name : String
    range : String
    range_ref : String
    columns : Array[String]
    style_name : String
    show_first_column : Bool
    show_last_column : Bool
    show_row_stripes : Bool
    show_column_stripes : Bool
    show_header_row : Bool
    }

    TableOptions

    type TableOptions derive(
    Debug
    )

    TableOptions::new

    fn TableOptions::new(range_ref : String) -> TableOptions raise XlsxError

    TableOptions::set_name

    fn TableOptions::set_name(self : TableOptions, name : String) -> Unit

    TableOptions::set_show_column_stripes

    fn TableOptions::set_show_column_stripes(self : TableOptions, value : Bool) -> Unit

    TableOptions::set_show_first_column

    fn TableOptions::set_show_first_column(self : TableOptions, value : Bool) -> Unit

    TableOptions::set_show_header_row

    fn TableOptions::set_show_header_row(self : TableOptions, value : Bool?) -> Unit

    TableOptions::set_show_last_column

    fn TableOptions::set_show_last_column(self : TableOptions, value : Bool) -> Unit

    TableOptions::set_show_row_stripes

    fn TableOptions::set_show_row_stripes(self : TableOptions, value : Bool?) -> Unit

    TableOptions::set_style_name

    fn TableOptions::set_style_name(self : TableOptions, style_name : String) -> Unit

    Workbook

    pub struct Workbook {
    sheets : Array[Worksheet]
    chart_sheets : Array[ChartSheet]
    sheet_order : Array[SheetEntry]
    styles : Array[Style]
    conditional_styles : Array[Style]
    defined_names : Array[DefinedName]
    core_properties : CoreProperties
    app_properties : AppProperties
    custom_properties : Array[CustomProperty]
    vba_project : Bytes?
    workbook_props : WorkbookPropsOptions
    calc_props : CalcPropsOptions
    default_font : String
    default_table_style : String
    default_pivot_style : String
    theme_colors : Array[String]?
    theme_xml : String?
    indexed_colors : Array[String]?
    mru_colors_xml : String?
    styles_ext_lst_xml : String?
    io_context : WorkbookIOContext
    options : Options
    workbook_protection : WorkbookProtection?
    active_sheet_index : Int
    cell_images : Array[CellImage]
    rich_value_images : RichValueImages?
    rich_value_media : Map[String, Bytes]
    }

    Workbook::active_sheet_index

    fn Workbook::active_sheet_index(self : Workbook) -> Int

    Workbook::add_chart

    fn Workbook::add_chart(self : Workbook, sheet_name : StringView, reference : String, xml : String) -> Unit raise XlsxError

    Workbook::add_chart_sheet

    fn Workbook::add_chart_sheet(self : Workbook, name : String, chart_xml : String) -> ChartSheet raise XlsxError

    Workbook::add_chart_sheet_with_options

    fn Workbook::add_chart_sheet_with_options(self : Workbook, name : String, opts : ChartOptions) -> ChartSheet raise XlsxError

    Workbook::add_chart_with_options

    fn Workbook::add_chart_with_options(self : Workbook, sheet_name : StringView, reference : String, opts : ChartOptions) -> Unit raise XlsxError

    Workbook::add_comment

    fn Workbook::add_comment(self : Workbook, sheet_name : StringView, comment : Comment) -> Unit raise XlsxError

    Workbook::add_conditional_format_xml

    fn Workbook::add_conditional_format_xml(self : Workbook, sheet_name : StringView, xml : String) -> Unit raise XlsxError

    Workbook::add_data_validation

    fn Workbook::add_data_validation(self : Workbook, sheet_name : StringView, dv : DataValidation) -> Unit raise XlsxError

    Workbook::add_data_validation_list

    fn Workbook::add_data_validation_list(self : Workbook, sheet_name : StringView, range_ref : String, values : ArrayView[String], allow_blank? : Bool) -> Unit raise XlsxError

    Workbook::add_data_validation_xml

    fn Workbook::add_data_validation_xml(self : Workbook, sheet_name : StringView, xml : String) -> Unit raise XlsxError

    Workbook::add_form_control

    fn Workbook::add_form_control(self : Workbook, sheet_name : StringView, control : FormControl) -> Unit raise XlsxError

    fn Workbook::add_header_footer_image(self : Workbook, sheet_name : StringView, options : HeaderFooterImageOptions) -> Unit raise XlsxError

    async fn Workbook::add_header_footer_image_from_file(self : Workbook, sheet_name : StringView, options : HeaderFooterImageOptions) -> Unit raise XlsxError

    Workbook::add_ignored_errors

    fn Workbook::add_ignored_errors(self : Workbook, sheet_name : StringView, range_ref : String, error_type : IgnoredErrorType) -> Unit raise XlsxError

    Workbook::add_image

    fn Workbook::add_image(self : Workbook, sheet_name : StringView, reference : String, data : Bytes, extension : String, content_type : String, offset_x? : Int, offset_y? : Int, scale_x? : Double, scale_y? : Double, hyperlink? : String, hyperlink_type? : HyperlinkType, name? : String, alt_text? : String, lock_aspect_ratio? : Bool, auto_fit? : Bool, auto_fit_ignore_aspect? : Bool, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> Unit raise XlsxError

    Workbook::add_image_with_options

    fn Workbook::add_image_with_options(self : Workbook, sheet_name : StringView, reference : String, data : Bytes, extension : String, content_type : String, options : GraphicOptions) -> Unit raise XlsxError

    Workbook::add_picture

    async fn Workbook::add_picture(self : Workbook, sheet_name : StringView, reference : String, path : String, offset_x? : Int, offset_y? : Int, scale_x? : Double, scale_y? : Double, hyperlink? : String, hyperlink_type? : HyperlinkType, name? : String, alt_text? : String, lock_aspect_ratio? : Bool, auto_fit? : Bool, auto_fit_ignore_aspect? : Bool, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> Unit raise XlsxError

    Workbook::add_picture_from_bytes

    fn Workbook::add_picture_from_bytes(self : Workbook, sheet_name : StringView, reference : String, data : Bytes, extension : String, offset_x? : Int, offset_y? : Int, scale_x? : Double, scale_y? : Double, hyperlink? : String, hyperlink_type? : HyperlinkType, name? : String, alt_text? : String, lock_aspect_ratio? : Bool, auto_fit? : Bool, auto_fit_ignore_aspect? : Bool, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> Unit raise XlsxError

    Workbook::add_picture_from_bytes_with_options

    fn Workbook::add_picture_from_bytes_with_options(self : Workbook, sheet_name : StringView, reference : String, data : Bytes, extension : String, options : GraphicOptions) -> Unit raise XlsxError

    Workbook::add_picture_with_options

    async fn Workbook::add_picture_with_options(self : Workbook, sheet_name : StringView, reference : String, path : String, options : GraphicOptions) -> Unit raise XlsxError

    Workbook::add_pivot_table

    fn Workbook::add_pivot_table(self : Workbook, opts : PivotTableOptions) -> PivotTable raise XlsxError

    Workbook::add_pivot_table_xml

    fn Workbook::add_pivot_table_xml(self : Workbook, sheet_name : StringView, table_xml : String, cache_definition_xml : String, cache_records_xml? : String, name? : String) -> PivotTable raise XlsxError

    Workbook::add_shape

    fn Workbook::add_shape(self : Workbook, sheet_name : StringView, shape : Shape) -> Unit raise XlsxError

    Workbook::add_sheet

    fn Workbook::add_sheet(self : Workbook, name : String) -> Worksheet raise XlsxError

    Creates a new worksheet named name, appends it after the existing sheets, and returns it for immediate use. Names must be unique and follow Excel's rules: 1–31 characters, may not start or end with a single quote ('), and may not contain any of [ ] : * ? / \.

    Raises XlsxError if name is empty, too long, starts/ends with ', contains an invalid character, or duplicates an existing sheet.

    Workbook::add_slicer

    fn Workbook::add_slicer(self : Workbook, sheet_name : StringView, opts : SlicerOptions) -> Unit raise XlsxError

    Workbook::add_slicer_raw

    fn Workbook::add_slicer_raw(self : Workbook, sheet_name : StringView, slicer : Slicer) -> Unit raise XlsxError

    Workbook::add_slicer_with_options

    fn Workbook::add_slicer_with_options(self : Workbook, sheet_name : StringView, opts : SlicerOptions) -> Unit raise XlsxError

    Workbook::add_sparkline

    fn Workbook::add_sparkline(self : Workbook, sheet_name : StringView, options : SparklineOptions) -> Unit raise XlsxError

    Workbook::add_sparkline_basic

    fn Workbook::add_sparkline_basic(self : Workbook, sheet_name : StringView, location : String, range_ref : String, sparkline_type? : SparklineType) -> Unit raise XlsxError

    Workbook::add_sparkline_group

    fn Workbook::add_sparkline_group(self : Workbook, sheet_name : StringView, locations : ArrayView[String], ranges : ArrayView[String], sparkline_type? : SparklineType) -> Unit raise XlsxError

    Workbook::add_sparkline_options

    fn Workbook::add_sparkline_options(self : Workbook, sheet_name : StringView, options : SparklineOptions) -> Unit raise XlsxError

    Workbook::add_style

    fn Workbook::add_style(self : Workbook, style : Style) -> Int

    Workbook::add_table

    fn Workbook::add_table(self : Workbook, sheet_name : StringView, options : TableOptions) -> Table raise XlsxError

    Workbook::add_table_with_columns

    fn Workbook::add_table_with_columns(self : Workbook, sheet_name : StringView, range_ref : String, name : String, columns : ArrayView[String], display_name? : String, style_name? : String, show_first_column? : Bool, show_last_column? : Bool, show_row_stripes? : Bool, show_column_stripes? : Bool, show_header_row? : Bool) -> Table raise XlsxError

    Workbook::add_vba_project

    fn Workbook::add_vba_project(self : Workbook, data : Bytes) -> Unit raise XlsxError

    Workbook::add_vbaproject

    fn Workbook::add_vbaproject(self : Workbook, data : Bytes) -> Unit raise XlsxError

    Workbook::add_vml_drawing_hf_xml

    fn Workbook::add_vml_drawing_hf_xml(self : Workbook, sheet_name : StringView, xml : String) -> Unit raise XlsxError

    Workbook::add_vml_drawing_xml

    fn Workbook::add_vml_drawing_xml(self : Workbook, sheet_name : StringView, xml : String) -> Unit raise XlsxError

    Workbook::app_properties

    fn Workbook::app_properties(self : Workbook) -> AppProperties

    Workbook::app_props

    fn Workbook::app_props(self : Workbook) -> AppProperties

    Workbook::auto_filter

    fn Workbook::auto_filter(self : Workbook, sheet_name : StringView, range_ref : String, options : ArrayView[AutoFilterOption]) -> Unit raise XlsxError

    Workbook::calc_cell_value

    fn Workbook::calc_cell_value(self : Workbook, sheet_name : StringView, reference : StringView, raw? : Bool, options? : Options) -> String raise XlsxError

    Workbook::calc_cell_value_rc

    fn Workbook::calc_cell_value_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, raw? : Bool, options? : Options) -> String raise XlsxError

    Workbook::charset_transcoder

    fn Workbook::charset_transcoder(self : Workbook, transcoder : (String, Bytes) -> String raise XlsxError) -> Workbook

    Workbook::chart_sheet

    fn Workbook::chart_sheet(self : Workbook, name : StringView) -> ChartSheet?

    Workbook::chart_sheets

    fn Workbook::chart_sheets(self : Workbook) -> ArrayView[ChartSheet]

    Workbook::clear_auto_filter

    fn Workbook::clear_auto_filter(self : Workbook, sheet_name : StringView) -> Unit raise XlsxError

    Workbook::clear_sheet_background

    fn Workbook::clear_sheet_background(self : Workbook, sheet_name : StringView) -> Unit raise XlsxError

    Workbook::col_outline_level

    fn Workbook::col_outline_level(self : Workbook, sheet_name : StringView, col : Int) -> Int raise XlsxError

    Returns the outline (grouping) level of column col (1-based) on sheet_name, or 0 if the column has no explicit level.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or col is less than 1.

    Workbook::col_visible

    fn Workbook::col_visible(self : Workbook, sheet_name : StringView, col : Int) -> Bool raise XlsxError

    Reports whether column col (1-based) on sheet_name is visible. Columns with no explicit dimension are visible by default.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or col is less than 1.

    Workbook::cols

    fn Workbook::cols(self : Workbook, sheet_name : StringView) -> Cols raise XlsxError

    Workbook::copy_sheet

    fn Workbook::copy_sheet(self : Workbook, from_index : Int, to_index : Int) -> Unit raise XlsxError

    Workbook::core_properties

    fn Workbook::core_properties(self : Workbook) -> CoreProperties

    Workbook::custom_properties

    fn Workbook::custom_properties(self : Workbook) -> Array[CustomProperty]

    Workbook::defined_names

    fn Workbook::defined_names(self : Workbook) -> ArrayView[DefinedName]

    Workbook::delete_chart

    fn Workbook::delete_chart(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::delete_comment

    fn Workbook::delete_comment(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::delete_data_validation

    fn Workbook::delete_data_validation(self : Workbook, sheet_name : StringView, sqrefs? : Array[String]) -> Unit raise XlsxError

    Workbook::delete_defined_name

    fn Workbook::delete_defined_name(self : Workbook, defined_name : DefinedName) -> Unit raise XlsxError

    Workbook::delete_form_control

    fn Workbook::delete_form_control(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::delete_picture

    fn Workbook::delete_picture(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::delete_pivot_table

    fn Workbook::delete_pivot_table(self : Workbook, sheet_name : StringView, name : StringView) -> Unit raise XlsxError

    Workbook::delete_sheet

    fn Workbook::delete_sheet(self : Workbook, name : StringView) -> Unit raise XlsxError

    Removes the sheet named name — a worksheet or a chart sheet — from the workbook, together with its cells and sheet-scoped settings. Does nothing if no sheet has that name, or if it is the workbook's only remaining sheet (a workbook must always keep at least one sheet).

    Raises XlsxError if name is not a valid sheet name.

    Workbook::delete_slicer

    fn Workbook::delete_slicer(self : Workbook, name : StringView) -> Unit raise XlsxError

    Workbook::delete_table

    fn Workbook::delete_table(self : Workbook, name : StringView) -> Unit raise XlsxError

    Workbook::doc_properties

    fn Workbook::doc_properties(self : Workbook) -> CoreProperties

    Workbook::duplicate_row

    fn Workbook::duplicate_row(self : Workbook, sheet_name : StringView, row : Int) -> Unit raise XlsxError

    Duplicates row row (1-based) on sheet_name, inserting the copy directly below as the new row row + 1 and shifting subsequent rows down. Convenience wrapper over duplicate_row_to.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, or if row is less than 1.

    Workbook::duplicate_row_to

    fn Workbook::duplicate_row_to(self : Workbook, sheet_name : StringView, row : Int, target_row : Int) -> Unit raise XlsxError

    Duplicates row row (1-based) on sheet_name into target_row: it inserts a new row at target_row (shifting existing rows there down) and copies the source row's cells and its full row dimension (height, visibility, outline level, style). Conditional formats, data validations, and single-row merged ranges scoped to the source row are also duplicated onto target_row, though merged-range duplication is skipped if target_row falls inside an existing merge. Defined names are adjusted for the insert.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if row is less than 1, or if target_row is less than 1 or equal to row.

    Workbook::get_active_sheet_index

    fn Workbook::get_active_sheet_index(self : Workbook) -> Int

    Workbook::get_app_props

    fn Workbook::get_app_props(self : Workbook) -> AppProperties

    Workbook::get_auto_filter

    fn Workbook::get_auto_filter(self : Workbook, sheet_name : StringView) -> AutoFilter? raise XlsxError

    Workbook::get_base_color

    fn Workbook::get_base_color(self : Workbook, hex_color : String, indexed_color : Int, theme_color? : Int) -> String

    Workbook::get_calc_props

    fn Workbook::get_calc_props(self : Workbook) -> CalcPropsOptions

    Workbook::get_cell

    fn Workbook::get_cell(self : Workbook, sheet_name : StringView, reference : StringView) -> String? raise XlsxError

    Workbook::get_cell_formula

    fn Workbook::get_cell_formula(self : Workbook, sheet_name : StringView, reference : StringView) -> String? raise XlsxError

    fn Workbook::get_cell_hyper_link(self : Workbook, sheet_name : StringView, reference : StringView) -> Hyperlink? raise XlsxError

    fn Workbook::get_cell_hyperlink(self : Workbook, sheet_name : StringView, reference : StringView) -> Hyperlink? raise XlsxError

    Workbook::get_cell_rc

    fn Workbook::get_cell_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int) -> String? raise XlsxError

    Workbook::get_cell_rich_text

    fn Workbook::get_cell_rich_text(self : Workbook, sheet_name : StringView, reference : StringView) -> Array[RichTextRun]? raise XlsxError

    Workbook::get_cell_style

    fn Workbook::get_cell_style(self : Workbook, sheet_name : StringView, reference : StringView) -> Int? raise XlsxError

    Workbook::get_cell_style_rc

    fn Workbook::get_cell_style_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int) -> Int? raise XlsxError

    Workbook::get_cell_type

    fn Workbook::get_cell_type(self : Workbook, sheet_name : StringView, reference : StringView) -> CellValueType? raise XlsxError

    Workbook::get_cell_value

    fn Workbook::get_cell_value(self : Workbook, sheet_name : StringView, reference : StringView, raw? : Bool, options? : Options) -> String? raise XlsxError

    Workbook::get_cell_value_raw

    fn Workbook::get_cell_value_raw(self : Workbook, sheet_name : StringView, reference : StringView) -> CellValue? raise XlsxError

    Workbook::get_cell_value_raw_rc

    fn Workbook::get_cell_value_raw_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int) -> CellValue? raise XlsxError

    Workbook::get_cell_value_rc

    fn Workbook::get_cell_value_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, raw? : Bool, options? : Options) -> String? raise XlsxError

    Workbook::get_col

    fn Workbook::get_col(self : Workbook, sheet_name : StringView, col : Int) -> Array[String] raise XlsxError

    Returns the raw string values of column col (1-based) on sheet_name, from row 1 through the last populated cell; empty cells within that span are returned as empty strings. Returns an empty array for a column with no cells.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or col is less than 1.

    Workbook::get_col_outline_level

    fn Workbook::get_col_outline_level(self : Workbook, sheet_name : StringView, col : Int) -> Int raise XlsxError

    Workbook::get_col_style

    fn Workbook::get_col_style(self : Workbook, sheet_name : StringView, col : Int) -> Int? raise XlsxError

    Returns the column-level style id of column col (1-based) on sheet_name, or None if the column has no explicit style.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or col is less than 1.

    Workbook::get_col_visible

    fn Workbook::get_col_visible(self : Workbook, sheet_name : StringView, col : Int) -> Bool raise XlsxError

    Workbook::get_col_width

    fn Workbook::get_col_width(self : Workbook, sheet_name : StringView, col : Int) -> Double? raise XlsxError

    Returns the explicitly-set width (in character units) of column col (1-based) on sheet_name, or None if the column uses the sheet default.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or col is less than 1.

    Workbook::get_cols

    fn Workbook::get_cols(self : Workbook, sheet_name : StringView, options? : Options) -> Array[Array[String]] raise XlsxError

    Workbook::get_comments

    fn Workbook::get_comments(self : Workbook, sheet_name : StringView) -> Array[Comment] raise XlsxError

    Workbook::get_conditional_formats

    fn Workbook::get_conditional_formats(self : Workbook, sheet_name : StringView) -> Map[String, Array[ConditionalFormatOptions]] raise XlsxError

    Workbook::get_conditional_style

    fn Workbook::get_conditional_style(self : Workbook, style_id : Int) -> Style raise XlsxError

    Workbook::get_custom_props

    fn Workbook::get_custom_props(self : Workbook) -> Array[CustomProperty]

    Workbook::get_data_validations

    fn Workbook::get_data_validations(self : Workbook, sheet_name : StringView) -> Array[DataValidation] raise XlsxError

    Workbook::get_default_font

    fn Workbook::get_default_font(self : Workbook) -> String

    Workbook::get_defined_name

    fn Workbook::get_defined_name(self : Workbook) -> Array[DefinedName]

    Workbook::get_defined_names

    fn Workbook::get_defined_names(self : Workbook) -> Array[DefinedName]

    Workbook::get_doc_props

    fn Workbook::get_doc_props(self : Workbook) -> CoreProperties

    Workbook::get_form_controls

    fn Workbook::get_form_controls(self : Workbook, sheet_name : StringView) -> Array[FormControl] raise XlsxError

    fn Workbook::get_header_footer(self : Workbook, sheet_name : StringView) -> HeaderFooterOptions? raise XlsxError

    fn Workbook::get_header_footer_images(self : Workbook, sheet_name : StringView) -> Array[HeaderFooterImageOptions] raise XlsxError

    fn Workbook::get_hyper_link_cells(self : Workbook, sheet_name : StringView, link_type? : HyperlinkType) -> Array[String] raise XlsxError

    fn Workbook::get_hyperlink_cells(self : Workbook, sheet_name : StringView, link_type? : HyperlinkType) -> Array[String] raise XlsxError

    Workbook::get_merge_cells

    fn Workbook::get_merge_cells(self : Workbook, sheet_name : StringView) -> Array[String] raise XlsxError

    Workbook::get_merge_cells_info

    fn Workbook::get_merge_cells_info(self : Workbook, sheet_name : StringView, without_values? : Bool, options? : Options) -> Array[MergeCell] raise XlsxError

    Workbook::get_page_layout

    fn Workbook::get_page_layout(self : Workbook, sheet_name : StringView) -> PageLayoutOptions raise XlsxError

    Workbook::get_page_margins

    fn Workbook::get_page_margins(self : Workbook, sheet_name : StringView) -> PageLayoutMarginsOptions raise XlsxError

    Workbook::get_panes

    fn Workbook::get_panes(self : Workbook, sheet_name : StringView) -> Panes raise XlsxError

    Workbook::get_picture_cells

    fn Workbook::get_picture_cells(self : Workbook, sheet_name : StringView) -> Array[String] raise XlsxError

    Workbook::get_pictures

    fn Workbook::get_pictures(self : Workbook, sheet_name : StringView, cell : StringView) -> Array[Image] raise XlsxError

    Workbook::get_pivot_tables

    fn Workbook::get_pivot_tables(self : Workbook, sheet_name : StringView) -> Array[PivotTable] raise XlsxError

    Workbook::get_row

    fn Workbook::get_row(self : Workbook, sheet_name : StringView, row : Int) -> Array[String] raise XlsxError

    Returns the raw string values of row row (1-based) on sheet_name, from column A through the last populated cell; empty cells within that span are returned as empty strings. Returns an empty array for a row with no cells.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or row is less than 1.

    Workbook::get_row_height

    fn Workbook::get_row_height(self : Workbook, sheet_name : StringView, row : Int) -> Double? raise XlsxError

    Returns the explicitly-set height (in points) of row row (1-based) on sheet_name, or None if the row uses the sheet default.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or row is less than 1.

    Workbook::get_row_outline_level

    fn Workbook::get_row_outline_level(self : Workbook, sheet_name : StringView, row : Int) -> Int raise XlsxError

    Workbook::get_row_style

    fn Workbook::get_row_style(self : Workbook, sheet_name : StringView, row : Int) -> Int? raise XlsxError

    Returns the row-level style id of row row (1-based) on sheet_name, or None if the row has no explicit style.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or row is less than 1.

    Workbook::get_row_visible

    fn Workbook::get_row_visible(self : Workbook, sheet_name : StringView, row : Int) -> Bool raise XlsxError

    Workbook::get_rows

    fn Workbook::get_rows(self : Workbook, sheet_name : StringView, options? : Options) -> Array[Array[String]] raise XlsxError

    Workbook::get_sheet_dimension

    fn Workbook::get_sheet_dimension(self : Workbook, sheet_name : StringView) -> String raise XlsxError

    Workbook::get_sheet_index

    fn Workbook::get_sheet_index(self : Workbook, name : StringView) -> Int raise XlsxError

    Workbook::get_sheet_list

    fn Workbook::get_sheet_list(self : Workbook) -> Array[String]

    Returns the names of all sheets — worksheets and chart sheets — in tab order.

    Workbook::get_sheet_map

    fn Workbook::get_sheet_map(self : Workbook) -> Map[Int, String]

    Workbook::get_sheet_name

    fn Workbook::get_sheet_name(self : Workbook, index : Int) -> String?

    Workbook::get_sheet_props

    fn Workbook::get_sheet_props(self : Workbook, sheet_name : StringView) -> SheetPropsOptions raise XlsxError

    Workbook::get_sheet_protection

    fn Workbook::get_sheet_protection(self : Workbook, sheet_name : StringView) -> SheetProtectionOptions raise XlsxError

    Workbook::get_sheet_view

    fn Workbook::get_sheet_view(self : Workbook, sheet_name : StringView, view_index : Int) -> SheetViewOptions raise XlsxError

    Workbook::get_sheet_visible

    fn Workbook::get_sheet_visible(self : Workbook, name : StringView) -> Bool raise XlsxError

    Workbook::get_slicers

    fn Workbook::get_slicers(self : Workbook, sheet_name : StringView) -> Array[Slicer] raise XlsxError

    Workbook::get_style

    fn Workbook::get_style(self : Workbook, style_id : Int) -> Style raise XlsxError

    Workbook::get_tables

    fn Workbook::get_tables(self : Workbook, sheet_name : StringView) -> Array[Table] raise XlsxError

    Workbook::get_workbook_props

    fn Workbook::get_workbook_props(self : Workbook) -> WorkbookPropsOptions

    Workbook::group_sheets

    fn Workbook::group_sheets(self : Workbook, sheets : Array[String]) -> Unit raise XlsxError

    Workbook::insert_cols

    fn Workbook::insert_cols(self : Workbook, sheet_name : StringView, col : Int, count : Int) -> Unit raise XlsxError

    Inserts count blank columns before column col (1-based) on sheet_name, shifting existing columns right along with their cells and associated features. Defined names referring to the sheet are adjusted to follow the shift.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if col is less than 1, or if count is not positive.

    Workbook::insert_page_break

    fn Workbook::insert_page_break(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::insert_rows

    fn Workbook::insert_rows(self : Workbook, sheet_name : StringView, row : Int, count : Int) -> Unit raise XlsxError

    Inserts count blank rows before row row (1-based) on sheet_name, shifting existing rows down along with their cells, row dimensions, merged ranges, hyperlinks, auto filter, tables, sparklines, images, charts, and page breaks. Defined names referring to the sheet are adjusted to follow the shift.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if row is less than 1, or if count is not positive.

    Workbook::merge_cell

    fn Workbook::merge_cell(self : Workbook, sheet_name : StringView, top_left : StringView, bottom_right : StringView) -> Unit raise XlsxError

    Workbook::merge_cells

    fn Workbook::merge_cells(self : Workbook, sheet_name : StringView, range_ref : String) -> Unit raise XlsxError

    Workbook::move_sheet

    fn Workbook::move_sheet(self : Workbook, source : StringView, target : StringView) -> Unit raise XlsxError

    Workbook::new

    fn Workbook::new(options? : Options) -> Workbook

    Workbook::new_conditional_style

    fn Workbook::new_conditional_style(self : Workbook, style : Style) -> Int

    Workbook::new_sheet

    fn Workbook::new_sheet(self : Workbook, name : String) -> Worksheet raise XlsxError

    Workbook::new_stream_writer

    fn Workbook::new_stream_writer(self : Workbook, sheet_name : StringView) -> StreamWriter raise XlsxError

    Workbook::new_style

    fn Workbook::new_style(self : Workbook, style : Style) -> Int

    Registers style with the workbook and returns its integer style id. Pass that id to the styling APIs — e.g. Worksheet::set_cell_style, Workbook::set_col_style, or the style_id field of RowOpts — to apply the formatting to cells, columns, or rows.

    Workbook::protect_sheet

    fn Workbook::protect_sheet(self : Workbook, sheet_name : StringView, options : SheetProtectionOptions) -> Unit raise XlsxError

    Workbook::protect_workbook

    fn Workbook::protect_workbook(self : Workbook, options? : WorkbookProtectionOptions) -> Unit raise XlsxError

    Workbook::read_zip_reader

    async fn[R :
    Reader
    ] Workbook::read_zip_reader(self : Workbook, reader : R, password? : String, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    fn Workbook::remove_cell_hyperlink(self : Workbook, sheet_name : StringView, reference : StringView) -> Unit raise XlsxError

    Workbook::remove_col

    fn Workbook::remove_col(self : Workbook, sheet_name : StringView, col : Int) -> Unit raise XlsxError

    Remove a single column (1-based) and shift columns left.

    Workbook::remove_cols

    fn Workbook::remove_cols(self : Workbook, sheet_name : StringView, col : Int, count : Int) -> Unit raise XlsxError

    Removes count columns starting at column col (1-based) on sheet_name, shifting the columns to its right leftward and adjusting associated features and defined names accordingly.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if col is less than 1, or if count is not positive.

    Workbook::remove_page_break

    fn Workbook::remove_page_break(self : Workbook, sheet_name : StringView, cell : StringView) -> Unit raise XlsxError

    Workbook::remove_row

    fn Workbook::remove_row(self : Workbook, sheet_name : StringView, row : Int) -> Unit raise XlsxError

    Remove a single row (1-based) and shift rows upward.

    Workbook::remove_rows

    fn Workbook::remove_rows(self : Workbook, sheet_name : StringView, row : Int, count : Int) -> Unit raise XlsxError

    Removes count rows starting at row row (1-based) on sheet_name, shifting the rows below up and adjusting row dimensions, merged ranges, hyperlinks, auto filter, tables, sparklines, images, charts, page breaks, and defined names accordingly.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if row is less than 1, or if count is not positive.

    Workbook::row_outline_level

    fn Workbook::row_outline_level(self : Workbook, sheet_name : StringView, row : Int) -> Int raise XlsxError

    Returns the outline (grouping) level of row row (1-based) on sheet_name, or 0 if the row has no explicit level.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or row is less than 1.

    Workbook::row_stream

    fn Workbook::row_stream(self : Workbook, sheet_name : StringView) -> RowStream raise XlsxError

    Workbook::row_visible

    fn Workbook::row_visible(self : Workbook, sheet_name : StringView, row : Int) -> Bool raise XlsxError

    Reports whether row row (1-based) on sheet_name is visible. Rows with no explicit dimension are visible by default.

    Raises XlsxError if the sheet name is invalid, no matching sheet exists, or row is less than 1.

    Workbook::rows

    fn Workbook::rows(self : Workbook, sheet_name : StringView) -> Rows raise XlsxError

    Workbook::save

    async fn Workbook::save(self : Workbook, options? : Options) -> Unit raise XlsxError

    Workbook::save_as

    async fn Workbook::save_as(self : Workbook, path : String, options? : Options) -> Unit raise XlsxError

    Workbook::search_sheet

    fn Workbook::search_sheet(self : Workbook, sheet_name : StringView, value : String, reg? : Bool) -> Array[String] raise XlsxError

    Workbook::set_active_sheet

    fn Workbook::set_active_sheet(self : Workbook, index : Int) -> Unit

    Marks the sheet at index (0-based, in tab order across worksheets and chart sheets) as the active sheet — the one Excel selects and shows when the workbook is opened. An out-of-range index falls back to the first sheet.

    Workbook::set_app_properties

    fn Workbook::set_app_properties(self : Workbook, props : AppProperties) -> Unit

    Workbook::set_app_props

    fn Workbook::set_app_props(self : Workbook, props : AppProperties) -> Unit

    Workbook::set_auto_filter

    fn Workbook::set_auto_filter(self : Workbook, sheet_name : StringView, range_ref : String, options : ArrayView[AutoFilterOption]) -> Unit raise XlsxError

    Workbook::set_calc_props

    fn Workbook::set_calc_props(self : Workbook, options : CalcPropsOptions?) -> Unit raise XlsxError

    Workbook::set_cell

    fn Workbook::set_cell(self : Workbook, sheet_name : StringView, reference : String, value : String) -> Unit raise XlsxError

    Workbook::set_cell_bool

    fn Workbook::set_cell_bool(self : Workbook, sheet_name : StringView, reference : String, value : Bool) -> Unit raise XlsxError

    Workbook::set_cell_default

    fn Workbook::set_cell_default(self : Workbook, sheet_name : StringView, reference : String, value : String) -> Unit raise XlsxError

    Workbook::set_cell_duration

    fn Workbook::set_cell_duration(self : Workbook, sheet_name : StringView, reference : String, value :
    Duration
    ) -> Unit raise XlsxError

    Sets a cell to a duration value the way Excelize's SetCellValue(time.Duration) does: the value is stored as a fraction of a day and the cell receives a default elapsed-time number format. The serial keeps full double precision (Go rounds through float32).

    Workbook::set_cell_float

    fn Workbook::set_cell_float(self : Workbook, sheet_name : StringView, reference : String, value : Double, precision? : Int, bit_size? : Int) -> Unit raise XlsxError

    Workbook::set_cell_formula

    fn Workbook::set_cell_formula(self : Workbook, sheet_name : StringView, reference : String, formula : String, value? : String) -> Unit raise XlsxError

    Workbook::set_cell_formula_opts

    fn Workbook::set_cell_formula_opts(self : Workbook, sheet_name : StringView, reference : String, formula : String, opts? : FormulaOpts, value? : String) -> Unit raise XlsxError

    Workbook::set_cell_formula_rc

    fn Workbook::set_cell_formula_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, formula : String, value? : String) -> Unit raise XlsxError

    fn Workbook::set_cell_hyper_link(self : Workbook, sheet_name : StringView, reference : String, target : String, link_type : HyperlinkType, display? : String, tooltip? : String) -> Unit raise XlsxError

    fn Workbook::set_cell_hyperlink(self : Workbook, sheet_name : StringView, reference : String, target : String, link_type : HyperlinkType, display? : String, tooltip? : String) -> Unit raise XlsxError

    fn Workbook::set_cell_hyperlink_opts(self : Workbook, sheet_name : StringView, reference : String, target : String, link_type : HyperlinkType, opts? : HyperlinkOpts) -> Unit raise XlsxError

    Workbook::set_cell_int

    fn Workbook::set_cell_int(self : Workbook, sheet_name : StringView, reference : String, value : Int) -> Unit raise XlsxError

    Workbook::set_cell_rc

    fn Workbook::set_cell_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, value : String) -> Unit raise XlsxError

    Workbook::set_cell_rich_text

    fn Workbook::set_cell_rich_text(self : Workbook, sheet_name : StringView, reference : String, runs : ArrayView[RichTextRun]) -> Unit raise XlsxError

    Workbook::set_cell_str

    fn Workbook::set_cell_str(self : Workbook, sheet_name : StringView, reference : String, value : String) -> Unit raise XlsxError

    Workbook::set_cell_style

    fn Workbook::set_cell_style(self : Workbook, sheet_name : StringView, reference : String, style_id : Int) -> Unit raise XlsxError

    Workbook::set_cell_style_rc

    fn Workbook::set_cell_style_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, style_id : Int) -> Unit raise XlsxError

    Workbook::set_cell_time

    fn Workbook::set_cell_time(self : Workbook, sheet_name : StringView, reference : String, value :
    ZonedDateTime
    ) -> Unit raise XlsxError

    Sets a cell to a datetime value the way Excelize's SetCellValue(time.Time) does: the value is stored as an Excel date serial (honoring the workbook's date-1904 setting) and the cell receives a default date/time number format. Datetimes before the epoch are stored as ISO-8601 text instead.

    Workbook::set_cell_uint

    fn Workbook::set_cell_uint(self : Workbook, sheet_name : StringView, reference : String, value : UInt) -> Unit raise XlsxError

    Workbook::set_cell_value

    fn Workbook::set_cell_value(self : Workbook, sheet_name : StringView, reference : String, value : CellValue) -> Unit raise XlsxError

    Workbook::set_cell_value_rc

    fn Workbook::set_cell_value_rc(self : Workbook, sheet_name : StringView, row : Int, col : Int, value : CellValue) -> Unit raise XlsxError

    Workbook::set_col

    fn Workbook::set_col(self : Workbook, sheet_name : StringView, col : Int, values : ArrayView[String]) -> Unit raise XlsxError

    Writes values down column col (1-based) starting at row 1, one raw string per cell, on sheet_name. Cells beyond values are left unchanged.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, if col is less than 1, or — when values is non-empty — StreamModeConflict if the sheet is in stream-writer mode.

    Workbook::set_col_outline_level

    fn Workbook::set_col_outline_level(self : Workbook, sheet_name : StringView, col : Int, level : Int) -> Unit raise XlsxError

    Sets the outline (grouping) level of column col (1-based) on sheet_name. level must be between 0 and 7 inclusive.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if col is less than 1, or if level is outside 0..=7.

    Workbook::set_col_outline_level_range

    fn Workbook::set_col_outline_level_range(self : Workbook, sheet_name : StringView, columns : StringView, level : Int) -> Unit raise XlsxError

    Workbook::set_col_style

    fn Workbook::set_col_style(self : Workbook, sheet_name : StringView, col : Int, style_id : Int) -> Unit raise XlsxError

    Sets the column-level style (applied to the whole column) of column col (1-based) on sheet_name. A style_id of 0 clears the column style.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, InvalidStyleId if style_id is out of range, StreamModeConflict if the sheet is in stream-writer mode, or if col is less than 1.

    Workbook::set_col_style_range

    fn Workbook::set_col_style_range(self : Workbook, sheet_name : StringView, columns : StringView, style_id : Int) -> Unit raise XlsxError

    Workbook::set_col_visible

    fn Workbook::set_col_visible(self : Workbook, sheet_name : StringView, col : Int, visible : Bool) -> Unit raise XlsxError

    Shows (visible true) or hides (visible false) column col (1-based) on sheet_name.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, or if col is less than 1.

    Workbook::set_col_visible_range

    fn Workbook::set_col_visible_range(self : Workbook, sheet_name : StringView, columns : StringView, visible : Bool) -> Unit raise XlsxError

    Workbook::set_col_width

    fn Workbook::set_col_width(self : Workbook, sheet_name : StringView, col : Int, width : Double) -> Unit raise XlsxError

    Sets the width (in character units) of column col (1-based) on sheet_name.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if col is less than 1, or if width is negative.

    Workbook::set_col_width_range

    fn Workbook::set_col_width_range(self : Workbook, sheet_name : StringView, columns : StringView, width : Double) -> Unit raise XlsxError

    Workbook::set_conditional_format

    fn Workbook::set_conditional_format(self : Workbook, sheet_name : StringView, range_ref : String, options : ArrayView[ConditionalFormatOptions]) -> Unit raise XlsxError

    Workbook::set_core_properties

    fn Workbook::set_core_properties(self : Workbook, props : CoreProperties) -> Unit

    Workbook::set_custom_props

    fn Workbook::set_custom_props(self : Workbook, prop : CustomProperty) -> Unit raise XlsxError

    Workbook::set_default_font

    fn Workbook::set_default_font(self : Workbook, font_name : String) -> Unit

    Workbook::set_defined_name

    fn Workbook::set_defined_name(self : Workbook, defined_name : DefinedName) -> Unit raise XlsxError

    Workbook::set_doc_properties

    fn Workbook::set_doc_properties(self : Workbook, props : CoreProperties) -> Unit

    Workbook::set_doc_props

    fn Workbook::set_doc_props(self : Workbook, props : CoreProperties) -> Unit

    fn Workbook::set_header_footer(self : Workbook, sheet_name : StringView, options : HeaderFooterOptions?) -> Unit raise XlsxError

    Workbook::set_page_layout

    fn Workbook::set_page_layout(self : Workbook, sheet_name : StringView, options : PageLayoutOptions?) -> Unit raise XlsxError

    Workbook::set_page_margins

    fn Workbook::set_page_margins(self : Workbook, sheet_name : StringView, options : PageLayoutMarginsOptions?) -> Unit raise XlsxError

    Workbook::set_panes

    fn Workbook::set_panes(self : Workbook, sheet_name : StringView, panes : Panes) -> Unit raise XlsxError

    Workbook::set_row

    fn Workbook::set_row(self : Workbook, sheet_name : StringView, row : Int, values : ArrayView[String]) -> Unit raise XlsxError

    Writes values across row row (1-based) starting at column A, one raw string per cell, on sheet sheet_name. Cells beyond values are left unchanged.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, if row is less than 1, or — when values is non-empty — StreamModeConflict if the sheet is in stream-writer mode.

    Workbook::set_row_height

    fn Workbook::set_row_height(self : Workbook, sheet_name : StringView, row : Int, height : Double) -> Unit raise XlsxError

    Sets the height (in points) of row row (1-based) on sheet_name.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if row is less than 1, or if height is negative.

    Workbook::set_row_outline_level

    fn Workbook::set_row_outline_level(self : Workbook, sheet_name : StringView, row : Int, level : Int) -> Unit raise XlsxError

    Sets the outline (grouping) level of row row (1-based) on sheet_name. level must be between 0 and 7 inclusive.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, if row is less than 1, or if level is outside 0..=7.

    Workbook::set_row_style

    fn Workbook::set_row_style(self : Workbook, sheet_name : StringView, row : Int, style_id : Int) -> Unit raise XlsxError

    Sets the row-level style (applied to the whole row) of row row (1-based) on sheet_name. A style_id of 0 clears the row style. Convenience wrapper over set_row_style_range for a single row.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, InvalidStyleId if style_id is out of range, StreamModeConflict if the sheet is in stream-writer mode, or if row is less than 1.

    Workbook::set_row_style_range

    fn Workbook::set_row_style_range(self : Workbook, sheet_name : StringView, start : Int, end : Int, style_id : Int) -> Unit raise XlsxError

    Sets the row-level style of every row from start to end (inclusive, 1-based) on sheet_name. A style_id of 0 clears the style for those rows.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, InvalidStyleId if style_id is out of range, StreamModeConflict if the sheet is in stream-writer mode, if start or end is less than 1, or if end is less than start.

    Workbook::set_row_visible

    fn Workbook::set_row_visible(self : Workbook, sheet_name : StringView, row : Int, visible : Bool) -> Unit raise XlsxError

    Shows (visible true) or hides (visible false) row row (1-based) on sheet_name.

    Raises XlsxError if the sheet name is invalid or no matching sheet exists, StreamModeConflict if the sheet is in stream-writer mode, or if row is less than 1.

    Workbook::set_sheet_background

    fn Workbook::set_sheet_background(self : Workbook, sheet_name : StringView, data : Bytes, extension : String) -> Unit raise XlsxError

    Workbook::set_sheet_background_from_bytes

    fn Workbook::set_sheet_background_from_bytes(self : Workbook, sheet_name : StringView, extension : String, data : Bytes) -> Unit raise XlsxError

    Workbook::set_sheet_background_from_file

    async fn Workbook::set_sheet_background_from_file(self : Workbook, sheet_name : StringView, path : String) -> Unit raise XlsxError

    Workbook::set_sheet_col

    fn Workbook::set_sheet_col(self : Workbook, sheet_name : StringView, cell : StringView, values : ArrayView[String]) -> Unit raise XlsxError

    Workbook::set_sheet_dimension

    fn Workbook::set_sheet_dimension(self : Workbook, sheet_name : StringView, range_ref : StringView) -> Unit raise XlsxError

    Workbook::set_sheet_name

    fn Workbook::set_sheet_name(self : Workbook, source : StringView, target : String) -> Unit raise XlsxError

    Workbook::set_sheet_props

    fn Workbook::set_sheet_props(self : Workbook, sheet_name : StringView, options : SheetPropsOptions?) -> Unit raise XlsxError

    Workbook::set_sheet_row

    fn Workbook::set_sheet_row(self : Workbook, sheet_name : StringView, cell : StringView, values : ArrayView[String]) -> Unit raise XlsxError

    Workbook::set_sheet_view

    fn Workbook::set_sheet_view(self : Workbook, sheet_name : StringView, view_index : Int, options : SheetViewOptions) -> Unit raise XlsxError

    Workbook::set_sheet_visible

    fn Workbook::set_sheet_visible(self : Workbook, name : StringView, visible : Bool, very_hidden? : Bool) -> Unit raise XlsxError

    Workbook::set_workbook_props

    fn Workbook::set_workbook_props(self : Workbook, options : WorkbookPropsOptions?) -> Unit

    Workbook::set_zip_writer

    fn Workbook::set_zip_writer(self : Workbook, writer : (
    Archive
    ) -> Bytes raise) -> Unit

    Workbook::sheet

    fn Workbook::sheet(self : Workbook, name : StringView) -> Worksheet?

    Returns the worksheet named name, or None if there is no worksheet with that name. A chart sheet of the same name is not returned by this method. Use add_sheet to create one, get_sheet_list to enumerate names, or sheets to iterate over every worksheet.

    Workbook::sheet_index

    fn Workbook::sheet_index(self : Workbook, name : StringView) -> Int raise XlsxError

    Workbook::sheet_name

    fn Workbook::sheet_name(self : Workbook, index : Int) -> String?

    Workbook::sheet_visible

    fn Workbook::sheet_visible(self : Workbook, name : StringView) -> Bool raise XlsxError

    Workbook::sheets

    fn Workbook::sheets(self : Workbook) -> ArrayView[Worksheet]

    Returns every worksheet as a view, for iteration, in the order the sheets were created (not necessarily tab order, and excluding chart sheets). Use sheet to look one up by name, or get_sheet_list for names in tab order.

    Workbook::styles

    fn Workbook::styles(self : Workbook) -> ArrayView[Style]

    Workbook::ungroup_sheets

    fn Workbook::ungroup_sheets(self : Workbook) -> Unit raise XlsxError

    Workbook::unmerge_cell

    fn Workbook::unmerge_cell(self : Workbook, sheet_name : StringView, top_left : StringView, bottom_right : StringView) -> Unit raise XlsxError

    Workbook::unmerge_cells

    fn Workbook::unmerge_cells(self : Workbook, sheet_name : StringView, range_ref : String) -> Unit raise XlsxError

    Workbook::unprotect_sheet

    fn Workbook::unprotect_sheet(self : Workbook, sheet_name : StringView, password? : String) -> Unit raise XlsxError

    Workbook::unprotect_workbook

    fn Workbook::unprotect_workbook(self : Workbook, password? : String) -> Unit raise XlsxError

    Workbook::unset_conditional_format

    fn Workbook::unset_conditional_format(self : Workbook, sheet_name : StringView, range_ref : String) -> Unit raise XlsxError

    Workbook::update_linked_value

    fn Workbook::update_linked_value(self : Workbook) -> Unit raise XlsxError

    Workbook::write

    async fn[W :
    Writer
    ] Workbook::write(self : Workbook, writer : W, options? : Options) -> Unit raise XlsxError

    Workbook::write_to

    async fn[W :
    Writer
    ] Workbook::write_to(self : Workbook, writer : W, options? : Options) -> Int raise XlsxError

    Workbook::write_to_buffer

    fn Workbook::write_to_buffer(self : Workbook, options? : Options) -> Bytes raise XlsxError

    WorkbookIOContext

    pub struct WorkbookIOContext {
    file_path : String?
    zip_writer : (
    Archive
    ) -> Bytes raise?
    charset_transcoder : (String, Bytes) -> String raise XlsxError?
    }

    WorkbookPropsOptions

    pub struct WorkbookPropsOptions {
    date_1904 : Bool?
    filter_privacy : Bool?
    code_name : String?
    } derive(
    Debug
    )

    WorkbookPropsOptions::with_values

    fn WorkbookPropsOptions::with_values(date_1904? : Bool, filter_privacy? : Bool, code_name? : String) -> WorkbookPropsOptions

    WorkbookProtection

    type WorkbookProtection derive(
    Debug
    )

    WorkbookProtectionOptions

    pub struct WorkbookProtectionOptions {
    algorithm_name : String
    password : String
    lock_structure : Bool
    lock_windows : Bool
    } derive(
    Debug
    )

    WorkbookProtectionOptions::with_values

    fn WorkbookProtectionOptions::with_values(algorithm_name? : String, password? : String, lock_structure? : Bool, lock_windows? : Bool) -> WorkbookProtectionOptions

    Worksheet

    pub struct Worksheet {
    name : String
    sheet_views : Array[SheetView]
    dimension_ref : String?
    cells : Array[Cell]
    cell_index : Map[String, Int]
    cell_index_valid : Bool
    merged_cells : Array[String]
    hyperlinks : Array[Hyperlink]
    tables : Array[Table]
    sparkline_groups : Array[SparklineGroup]
    pivot_tables : Array[PivotTable]
    images : Array[Image]
    header_footer_images : Array[HeaderFooterImage]
    charts : Array[Chart]
    shapes : Array[Shape]
    form_controls : Array[FormControl]
    slicers : Array[Slicer]
    data_validations : Array[String]
    conditional_formats : Array[String]
    x14_data_bars : Map[String, X14DataBarProps]
    unknown_ext_blocks : Array[String]
    x14_cf_rule_id_counter : Int
    ignored_errors : Array[IgnoredError]
    comments : Array[Comment]
    auto_filter : AutoFilter?
    page_margins : PageLayoutMarginsOptions?
    page_layout : PageLayoutOptions?
    header_footer : HeaderFooterOptions?
    sheet_protection : SheetProtection?
    sheet_props : SheetPropsOptions?
    sheet_background : SheetBackground?
    row_breaks : Array[PageBreak]
    col_breaks : Array[PageBreak]
    row_dimensions : Map[Int, RowDimension]
    col_dimensions : Map[Int, ColDimension]
    state : SheetState
    stream_state : StreamState
    vml_drawing_xml : String?
    vml_drawing_hf_xml : String?
    cell_vm : Map[String, Int]
    }

    Worksheet::add_chart

    fn Worksheet::add_chart(self : Worksheet, reference : String, xml : String) -> Unit raise XlsxError

    Worksheet::add_chart_with_options

    fn Worksheet::add_chart_with_options(self : Worksheet, reference : String, opts : ChartOptions) -> Unit raise XlsxError

    Worksheet::add_comment

    fn Worksheet::add_comment(self : Worksheet, comment : Comment) -> Unit raise XlsxError

    Worksheet::add_conditional_format_xml

    fn Worksheet::add_conditional_format_xml(self : Worksheet, xml : String) -> Unit

    Worksheet::add_data_validation

    fn Worksheet::add_data_validation(self : Worksheet, dv : DataValidation) -> Unit raise XlsxError

    Worksheet::add_data_validation_list

    fn Worksheet::add_data_validation_list(self : Worksheet, range_ref : String, values : ArrayView[String], allow_blank? : Bool) -> Unit raise XlsxError

    Worksheet::add_form_control

    fn Worksheet::add_form_control(self : Worksheet, control : FormControl) -> Unit raise XlsxError

    fn Worksheet::add_header_footer_image(self : Worksheet, options : HeaderFooterImageOptions) -> Unit raise XlsxError

    Worksheet::add_ignored_errors

    fn Worksheet::add_ignored_errors(self : Worksheet, range_ref : String, error_type : IgnoredErrorType) -> Unit raise XlsxError

    Worksheet::add_image

    fn Worksheet::add_image(self : Worksheet, reference : String, data : Bytes, extension : String, content_type : String, offset_x? : Int, offset_y? : Int, scale_x? : Double, scale_y? : Double, hyperlink? : String, hyperlink_type? : HyperlinkType, name? : String, alt_text? : String, lock_aspect_ratio? : Bool, auto_fit? : Bool, auto_fit_ignore_aspect? : Bool, print_object? : Bool, locked? : Bool, positioning? : PicturePositioning) -> Unit raise XlsxError

    Worksheet::add_pivot_table_xml

    fn Worksheet::add_pivot_table_xml(self : Worksheet, table_xml : String, cache_definition_xml : String, cache_records_xml? : String, name? : String) -> PivotTable raise XlsxError

    Worksheet::add_shape

    fn Worksheet::add_shape(self : Worksheet, shape : Shape) -> Unit raise XlsxError

    Worksheet::add_slicer

    fn Worksheet::add_slicer(self : Worksheet, slicer : Slicer) -> Unit raise XlsxError

    Worksheet::add_sparkline

    fn Worksheet::add_sparkline(self : Worksheet, location : String, range_ref : String, sparkline_type? : SparklineType) -> Unit raise XlsxError

    Worksheet::add_sparkline_group

    fn Worksheet::add_sparkline_group(self : Worksheet, locations : ArrayView[String], ranges : ArrayView[String], sparkline_type? : SparklineType) -> Unit raise XlsxError

    Worksheet::add_sparkline_options

    fn Worksheet::add_sparkline_options(self : Worksheet, options : SparklineOptions) -> Unit raise XlsxError

    Worksheet::add_table

    fn Worksheet::add_table(self : Worksheet, range_ref : String, name : String, columns : ArrayView[String], display_name? : String, style_name? : String, show_first_column? : Bool, show_last_column? : Bool, show_row_stripes? : Bool, show_column_stripes? : Bool, show_header_row? : Bool) -> Table raise XlsxError

    Worksheet::add_vml_drawing_hf_xml

    fn Worksheet::add_vml_drawing_hf_xml(self : Worksheet, xml : String) -> Unit raise XlsxError

    Worksheet::add_vml_drawing_xml

    fn Worksheet::add_vml_drawing_xml(self : Worksheet, xml : String) -> Unit raise XlsxError

    Worksheet::auto_filter

    fn Worksheet::auto_filter(self : Worksheet) -> AutoFilter?

    Worksheet::charts

    fn Worksheet::charts(self : Worksheet) -> ArrayView[Chart]

    Worksheet::clear_auto_filter

    fn Worksheet::clear_auto_filter(self : Worksheet) -> Unit raise XlsxError

    Worksheet::col_breaks

    fn Worksheet::col_breaks(self : Worksheet) -> ArrayView[PageBreak]

    Worksheet::col_outline_level

    fn Worksheet::col_outline_level(self : Worksheet, col : Int) -> Int raise XlsxError

    Worksheet::col_visible

    fn Worksheet::col_visible(self : Worksheet, col : Int) -> Bool raise XlsxError

    Worksheet::cols

    fn Worksheet::cols(self : Worksheet) -> Cols

    Worksheet::comments

    fn Worksheet::comments(self : Worksheet) -> ArrayView[Comment]

    Worksheet::conditional_formats

    fn Worksheet::conditional_formats(self : Worksheet) -> ArrayView[String]

    Worksheet::data_validations

    fn Worksheet::data_validations(self : Worksheet) -> ArrayView[String]

    Worksheet::delete_chart

    fn Worksheet::delete_chart(self : Worksheet, cell : StringView) -> Unit raise XlsxError

    Worksheet::delete_comment

    fn Worksheet::delete_comment(self : Worksheet, cell : StringView) -> Unit raise XlsxError

    Worksheet::delete_data_validation

    fn Worksheet::delete_data_validation(self : Worksheet, sqrefs? : Array[String]) -> Unit raise XlsxError

    Worksheet::delete_pivot_table

    fn Worksheet::delete_pivot_table(self : Worksheet, name : StringView) -> Unit raise XlsxError

    Worksheet::delete_table

    fn Worksheet::delete_table(self : Worksheet, name : StringView) -> Unit raise XlsxError

    Worksheet::get_cell

    fn Worksheet::get_cell(self : Worksheet, reference : StringView) -> String? raise XlsxError

    Returns the raw string value of the cell at reference (A1 notation), or None if the cell has never been set. Numbers and booleans are returned in their stored string form; use get_cell_value_raw to recover the typed CellValue instead.

    Raises XlsxError if reference is not a valid A1 cell reference.

    Worksheet::get_cell_formula

    fn Worksheet::get_cell_formula(self : Worksheet, reference : StringView) -> String? raise XlsxError

    fn Worksheet::get_cell_hyperlink(self : Worksheet, reference : StringView) -> Hyperlink? raise XlsxError

    Worksheet::get_cell_rc

    fn Worksheet::get_cell_rc(self : Worksheet, row : Int, col : Int) -> String? raise XlsxError

    Worksheet::get_cell_rich_text

    fn Worksheet::get_cell_rich_text(self : Worksheet, reference : StringView) -> Array[RichTextRun]? raise XlsxError

    Worksheet::get_cell_style

    fn Worksheet::get_cell_style(self : Worksheet, reference : StringView) -> Int? raise XlsxError

    Worksheet::get_cell_style_rc

    fn Worksheet::get_cell_style_rc(self : Worksheet, row : Int, col : Int) -> Int? raise XlsxError

    Worksheet::get_cell_value_raw

    fn Worksheet::get_cell_value_raw(self : Worksheet, reference : StringView) -> CellValue? raise XlsxError

    Returns the typed CellValue stored at reference (A1 notation), or None if the cell has never been set. Unlike get_cell, this preserves the value type (number vs. text vs. boolean) rather than coercing to a string.

    Raises XlsxError if reference is not a valid A1 cell reference.

    Worksheet::get_col

    fn Worksheet::get_col(self : Worksheet, col : Int) -> Array[String] raise XlsxError

    Worksheet::get_col_style

    fn Worksheet::get_col_style(self : Worksheet, col : Int) -> Int? raise XlsxError

    Worksheet::get_col_width

    fn Worksheet::get_col_width(self : Worksheet, col : Int) -> Double? raise XlsxError

    Worksheet::get_cols

    fn Worksheet::get_cols(self : Worksheet) -> Array[Array[String]]

    Worksheet::get_conditional_formats

    fn Worksheet::get_conditional_formats(self : Worksheet) -> Map[String, Array[ConditionalFormatOptions]] raise XlsxError

    Worksheet::get_data_validations

    fn Worksheet::get_data_validations(self : Worksheet) -> Array[DataValidation] raise XlsxError

    fn Worksheet::get_header_footer_images(self : Worksheet) -> Array[HeaderFooterImageOptions]

    fn Worksheet::get_hyperlink_cells(self : Worksheet, link_type? : HyperlinkType) -> Array[String]

    Returns the cell references of hyperlinks in the worksheet, mirroring Excelize's GetHyperLinkCells. Omitting link_type returns every hyperlink; External and Location filter by hyperlink kind; Unset (Excelize's "None") returns no references.

    Worksheet::get_panes

    fn Worksheet::get_panes(self : Worksheet) -> Panes

    Worksheet::get_row

    fn Worksheet::get_row(self : Worksheet, row : Int) -> Array[String] raise XlsxError

    Returns the raw string values of row row (1-based) from column A through the last populated cell. Empty cells within that span are returned as empty strings. Returns an empty array for a row with no cells.

    Raises XlsxError if row is less than 1.

    Worksheet::get_row_height

    fn Worksheet::get_row_height(self : Worksheet, row : Int) -> Double? raise XlsxError

    Worksheet::get_rows

    fn Worksheet::get_rows(self : Worksheet) -> Array[Array[String]]

    Worksheet::get_sheet_protection

    fn Worksheet::get_sheet_protection(self : Worksheet) -> SheetProtectionOptions

    Returns the protection options currently applied to the worksheet, mirroring Excelize's GetSheetProtection: stored restrictive flags are inverted back into permission options, the password is never returned, and an unprotected sheet yields all-default options.

    Worksheet::ignored_errors

    fn Worksheet::ignored_errors(self : Worksheet) -> ArrayView[IgnoredError]

    Worksheet::images

    fn Worksheet::images(self : Worksheet) -> ArrayView[Image]

    Worksheet::max_col

    fn Worksheet::max_col(self : Worksheet) -> Int

    Worksheet::max_row

    fn Worksheet::max_row(self : Worksheet) -> Int

    Worksheet::merge_cells

    fn Worksheet::merge_cells(self : Worksheet, range_ref : String) -> Unit raise XlsxError

    Merges the rectangular range range_ref (e.g. "A1:C3") into a single region; the top-left cell's value is displayed across the whole range. The range is normalized, so "C3:A1" and "A1:C3" are equivalent.

    Raises XlsxError if range_ref is not a valid range reference.

    Worksheet::merged_cells

    fn Worksheet::merged_cells(self : Worksheet) -> ArrayView[String]

    Worksheet::name

    fn Worksheet::name(self : Worksheet) -> String

    Worksheet::new

    fn Worksheet::new(name : String) -> Worksheet

    Worksheet::pivot_tables

    fn Worksheet::pivot_tables(self : Worksheet) -> ArrayView[PivotTable]

    Worksheet::protect_sheet

    fn Worksheet::protect_sheet(self : Worksheet, options : SheetProtectionOptions) -> Unit raise XlsxError

    fn Worksheet::remove_cell_hyperlink(self : Worksheet, reference : StringView) -> Unit raise XlsxError

    Worksheet::row_breaks

    fn Worksheet::row_breaks(self : Worksheet) -> ArrayView[PageBreak]

    Worksheet::row_stream

    fn Worksheet::row_stream(self : Worksheet) -> RowStream

    Worksheet::row_visible

    fn Worksheet::row_visible(self : Worksheet, row : Int) -> Bool raise XlsxError

    Worksheet::rows

    fn Worksheet::rows(self : Worksheet) -> Rows

    Worksheet::set_auto_filter

    fn Worksheet::set_auto_filter(self : Worksheet, range_ref : String, options : ArrayView[AutoFilterOption]) -> Unit raise XlsxError

    Worksheet::set_cell

    fn Worksheet::set_cell(self : Worksheet, reference : String, value : String) -> Unit raise XlsxError

    Writes value into the cell at reference (A1 notation, e.g. "B2") as a raw string, overwriting any existing content while preserving the cell's style. For numeric or boolean values use set_cell_value; for dates and times use Workbook::set_cell_time; for formulas use set_cell_formula.

    Raises XlsxError if reference is not a valid A1 cell reference, or StreamModeConflict if the worksheet is currently driven by a stream writer.

    Worksheet::set_cell_formula

    fn Worksheet::set_cell_formula(self : Worksheet, reference : String, formula : String, value? : String) -> Unit raise XlsxError

    Worksheet::set_cell_formula_opts

    fn Worksheet::set_cell_formula_opts(self : Worksheet, reference : String, formula : String, opts? : FormulaOpts, value? : String) -> Unit raise XlsxError

    Worksheet::set_cell_formula_rc

    fn Worksheet::set_cell_formula_rc(self : Worksheet, row : Int, col : Int, formula : String, value? : String) -> Unit raise XlsxError

    fn Worksheet::set_cell_hyperlink(self : Worksheet, reference : String, target : String, link_type : HyperlinkType, display? : String, tooltip? : String) -> Unit raise XlsxError

    fn Worksheet::set_cell_hyperlink_opts(self : Worksheet, reference : String, target : String, link_type : HyperlinkType, opts? : HyperlinkOpts) -> Unit raise XlsxError

    Worksheet::set_cell_rc

    fn Worksheet::set_cell_rc(self : Worksheet, row : Int, col : Int, value : String) -> Unit raise XlsxError

    Worksheet::set_cell_rich_text

    fn Worksheet::set_cell_rich_text(self : Worksheet, reference : String, runs : ArrayView[RichTextRun]) -> Unit raise XlsxError

    Worksheet::set_cell_style

    fn Worksheet::set_cell_style(self : Worksheet, reference : String, style_id : Int) -> Unit raise XlsxError

    Worksheet::set_cell_style_rc

    fn Worksheet::set_cell_style_rc(self : Worksheet, row : Int, col : Int, style_id : Int) -> Unit raise XlsxError

    Worksheet::set_cell_value

    fn Worksheet::set_cell_value(self : Worksheet, reference : String, value : CellValue) -> Unit raise XlsxError

    Writes a typed CellValue (number, string, boolean, …) into the cell at reference (A1 notation), overwriting existing content while preserving the cell's style. Prefer this over set_cell when the value should be stored as a number or boolean rather than as text (so Excel treats it numerically).

    Raises XlsxError if reference is not a valid A1 cell reference, or StreamModeConflict if the worksheet is currently driven by a stream writer.

    Worksheet::set_cell_value_rc

    fn Worksheet::set_cell_value_rc(self : Worksheet, row : Int, col : Int, value : CellValue) -> Unit raise XlsxError

    Worksheet::set_col

    fn Worksheet::set_col(self : Worksheet, col : Int, values : ArrayView[String]) -> Unit raise XlsxError

    Writes values down column col (1-based) starting at row 1, one raw string per cell. Cells beyond values are left unchanged.

    Raises XlsxError if col is less than 1, or — when values is non-empty — StreamModeConflict if the worksheet is driven by a stream writer.

    Worksheet::set_col_visible

    fn Worksheet::set_col_visible(self : Worksheet, col : Int, visible : Bool) -> Unit raise XlsxError

    Worksheet::set_col_width

    fn Worksheet::set_col_width(self : Worksheet, col : Int, width : Double) -> Unit raise XlsxError

    Worksheet::set_conditional_format

    fn Worksheet::set_conditional_format(self : Worksheet, range_ref : String, options : ArrayView[ConditionalFormatOptions]) -> Unit raise XlsxError

    fn Worksheet::set_header_footer(self : Worksheet, options : HeaderFooterOptions?) -> Unit raise XlsxError

    Worksheet::set_page_layout

    fn Worksheet::set_page_layout(self : Worksheet, options : PageLayoutOptions?) -> Unit raise XlsxError

    Worksheet::set_page_margins

    fn Worksheet::set_page_margins(self : Worksheet, options : PageLayoutMarginsOptions?) -> Unit raise XlsxError

    Worksheet::set_panes

    fn Worksheet::set_panes(self : Worksheet, panes : Panes) -> Unit raise XlsxError

    Worksheet::set_row

    fn Worksheet::set_row(self : Worksheet, row : Int, values : ArrayView[String]) -> Unit raise XlsxError

    Writes values across row row (1-based) starting at column A, one raw string per cell. Cells beyond values are left unchanged. For a single typed cell use set_cell_value; to build very large sheets efficiently use the stream writer (Workbook::new_stream_writer).

    Raises XlsxError if row is less than 1, or — when values is non-empty — StreamModeConflict if the worksheet is driven by a stream writer.

    Worksheet::set_row_height

    fn Worksheet::set_row_height(self : Worksheet, row : Int, height : Double) -> Unit raise XlsxError

    Worksheet::set_row_outline_level

    fn Worksheet::set_row_outline_level(self : Worksheet, row : Int, level : Int) -> Unit raise XlsxError

    Worksheet::set_row_style

    fn Worksheet::set_row_style(self : Worksheet, row : Int, style_id : Int) -> Unit raise XlsxError

    Worksheet::set_row_visible

    fn Worksheet::set_row_visible(self : Worksheet, row : Int, visible : Bool) -> Unit raise XlsxError

    Worksheet::set_sheet_background

    fn Worksheet::set_sheet_background(self : Worksheet, data : Bytes, extension : String) -> Unit raise XlsxError

    Worksheet::shapes

    fn Worksheet::shapes(self : Worksheet) -> ArrayView[Shape]

    Worksheet::sheet_background

    fn Worksheet::sheet_background(self : Worksheet) -> SheetBackground?

    Worksheet::sheet_protection

    fn Worksheet::sheet_protection(self : Worksheet) -> SheetProtection?

    Worksheet::sparkline_groups

    fn Worksheet::sparkline_groups(self : Worksheet) -> ArrayView[SparklineGroup]

    Worksheet::state

    fn Worksheet::state(self : Worksheet) -> SheetState

    Worksheet::tables

    fn Worksheet::tables(self : Worksheet) -> ArrayView[Table]

    Worksheet::unmerge_cells

    fn Worksheet::unmerge_cells(self : Worksheet, range_ref : String) -> Unit raise XlsxError

    Worksheet::unprotect_sheet

    fn Worksheet::unprotect_sheet(self : Worksheet, password? : String) -> Unit raise XlsxError

    Worksheet::unset_conditional_format

    fn Worksheet::unset_conditional_format(self : Worksheet, range_ref : String) -> Unit raise XlsxError

    Worksheet::vml_drawing_hf_xml

    fn Worksheet::vml_drawing_hf_xml(self : Worksheet) -> String?

    Worksheet::vml_drawing_xml

    fn Worksheet::vml_drawing_xml(self : Worksheet) -> String?

    X14DataBarProps

    type X14DataBarProps derive(
    Debug
    )

    cell_name_to_coordinates

    fn cell_name_to_coordinates(cell : StringView) -> (Int, Int) raise XlsxError

    Converts a cell reference to (column, row) coordinates, both 1-based, e.g. "C5" -> (3, 5). The tuple is column-first, not row-first. Inverse of coordinates_to_cell_name.

    Raises InvalidCellRef if cell is malformed, its row exceeds 1048576, or its column exceeds 16384 (the sheet grid limits).

    column_name_to_number

    fn column_name_to_number(name : StringView) -> Int raise XlsxError

    Converts a column-letter reference to its 1-based column number, e.g. "A" -> 1, "Z" -> 26, "AA" -> 27. Letters are case-insensitive. Inverse of column_number_to_name.

    Raises InvalidCellRef if name is empty, contains any non-letter character, or is long enough that the column number overflows.

    column_number_to_name

    fn column_number_to_name(col : Int) -> String raise XlsxError

    Converts a 1-based column number to its letter reference, e.g. 1 -> "A", 26 -> "Z", 27 -> "AA". Inverse of column_name_to_number.

    Raises InvalidCellRef if col is less than 1.

    coordinates_to_cell_name

    fn coordinates_to_cell_name(col : Int, row : Int, abs? : Bool) -> String raise XlsxError

    Converts 1-based (col, row) coordinates to a cell reference, e.g. (3, 5) -> "C5". When abs is true each part is prefixed with $ to form an absolute reference, so (3, 5) -> "$C$5". Inverse of cell_name_to_coordinates.

    Raises InvalidCellRef if col or row is less than 1, the row exceeds 1048576, or the column exceeds 16384.

    decrypt

    fn decrypt(raw : BytesView, options? : Options) -> Bytes raise XlsxError

    encrypt

    fn encrypt(raw : BytesView, options? : Options) -> Bytes raise XlsxError

    excel_date_to_time

    fn excel_date_to_time(excel_date : Double, use_1904_format? : Bool) ->
    ZonedDateTime
    raise XlsxError

    hsl_to_rgb

    fn hsl_to_rgb(h : Double, s : Double, l : Double) -> (Byte, Byte, Byte)

    join_cell_name

    fn join_cell_name(col : StringView, row : Int) -> String raise XlsxError

    Joins column letters and a 1-based row number into a cell reference, e.g. ("A", 2) -> "A2". The column is normalized (lowercase letters are upper-cased), so ("a", 2) also yields "A2". Inverse of split_cell_name.

    Raises InvalidCellRef if col is not valid column letters or row is less than 1.

    open_file

    async fn open_file(path : String, password? : String, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    open_reader

    async fn[R :
    Reader
    ] open_reader(reader : R, password? : String, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    read

    fn read(bytes : BytesView, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    read_with_password

    fn read_with_password(bytes : BytesView, password : String, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    read_zip_reader

    async fn[R :
    Reader
    ] read_zip_reader(reader : R, password? : String, options? : Options, transcoder? : (String, Bytes) -> String raise XlsxError) -> Workbook raise XlsxError

    rgb_to_hsl

    fn rgb_to_hsl(r : Byte, g : Byte, b : Byte) -> (Double, Double, Double)

    set_random_source

    fn set_random_source(source : (Int) -> Bytes) -> Unit

    Installs a custom source for the random bytes used in workbook encryption and sheet-protection salts, verifiers, and keys. The function receives the byte count required and must return exactly that many bytes.

    Use this to supply cryptographically secure entropy (Go excelize uses crypto/rand for these values). The built-in fallback is a ChaCha8 generator seeded from wall-clock entropy whitened through SHA-256: best-effort unique per process (millisecond clock resolution means simultaneous process starts can collide), and not a CSPRNG.

    split_cell_name

    fn split_cell_name(cell : StringView) -> (String, Int) raise XlsxError

    Splits a cell reference into its column letters and 1-based row number, e.g. "AB12" -> ("AB", 12). Column letters are upper-cased and absolute- reference $ markers are ignored, so "$C$5" -> ("C", 5).

    Raises InvalidCellRef if cell is empty, is missing either the column or the row part, has letters following digits, contains an unexpected character, has a row of 0, or has a row number too large to parse.

    theme_color

    fn theme_color(base_color : String, tint : Double) -> String

    time_to_excel_date

    fn time_to_excel_date(value :
    ZonedDateTime
    , use_1904_format? : Bool) -> Double

    Converts a wall-clock datetime to an Excel serial date, mirroring Excelize's timeToExcelTime: days are counted from the 1900 epoch (1899-12-31, with the intentional Lotus 1-2-3 bug adding one day from 1900-03-01 onward) or from the 1904 epoch (1904-01-01). Values before the epoch return 0. The datetime's own wall-clock fields are used, so the zone offset never shifts the stored value.

    Example

    test {
    let dt = @time.date_time(2021, 1, 1, hour=12)
    inspect(@xlsx.time_to_excel_date(dt), content="44197.5")
    }

    validate_ooxml_package

    fn validate_ooxml_package(bytes : BytesView) -> Array[String]

    Checks the structural invariants an OOXML (xlsx) package must satisfy for Microsoft Excel to open it without a repair prompt, returning the list of problems found (empty when the package is well-formed). These are the package-level rules the OOXML schema validator does not fully cover and that are the common causes of Excel's "we found a problem" dialog:

    • the archive is a readable zip
    • [Content_Types].xml and the root _rels/.rels exist
    • every part is covered by a Default (by extension) or an Override content type
    • every relationship target (except external ones) resolves to a part that exists in the package
    • no duplicate part names, and part names are well-formed
    • the core workbook parts are present

    This is a fast, dependency-free complement to the Microsoft OpenXML SDK validator: it runs entirely in MoonBit, so it can be asserted on every workbook a test generates.

    write

    fn write(workbook : Workbook) -> Bytes raise XlsxError

    write_with_password

    fn write_with_password(workbook : Workbook, password : String) -> Bytes raise XlsxError

    Source Files