class Xlsxrb::StreamWriter::WorksheetProxy
Proxy object yielded by the sheet method to prevent writing to inactive sheets in streaming mode.
@api public
Public Class Methods
(untyped writer, untyped sheet_name) → untyped
Source
# File lib/xlsxrb/stream_writer.rb, line 132 def initialize(writer, sheet_name) @writer = writer @sheet_name = sheet_name end
@param writer [StreamWriter] @param sheet_name [String]
Public Instance Methods
(Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?outline_level: Integer | nil) → void
(String | Symbol name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 702 def app_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.app_property(...) end
simplecov:disable Edge case / untested delegation block Sets app metadata property.
@param name [String, Symbol] Property name. @param value [Object] Property value. @return [void] @api public
(String ref) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 306 def auto_filter(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.auto_filter(...) end
Sets the auto-filter range on the active sheet.
@example
s.auto_filter("A1:D100")
@param ref [String] The cell range (e.g. “A1:D10”). @return [void] @api public
(?Symbol | String? type, **untyped opts) ?{ (Xlsxrb::ChartBuilder) → void } → void
Source
# File lib/xlsxrb/stream_writer.rb, line 269 def chart(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.chart(...) end
Adds a chart to the active sheet.
@example
s.chart(:bar) do |chart_builder| chart_builder.title("Quarterly Sales") chart_builder.series(values: "Sheet1!$B$2:$B$5", categories: "Sheet1!$A$2:$A$5", name: "Revenue") end
@param type [Symbol, String, nil] The chart type (:bar, :col, :line, :pie, :scatter, :area, :doughnut, :radar). @param opts [Hash] Additional chart options. @yield [chart_builder] @yieldparam chart_builder [Xlsxrb::ChartBuilder] @return [void] @api public
() → void
Source
# File lib/xlsxrb/stream_writer.rb, line 402 def cleanup!(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.cleanup!(...) end
simplecov:disable Edge case / untested delegation block
(Integer | String | Symbol | Range[Integer | String] | Array[Integer | String] col_index, ?width: Float | Integer | nil, ?hidden: bool, ?best_fit: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 248 def column(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.column(...) end
Configures column width and properties.
@example Set column A width
s.column(0, width: 25.0)
@param col_index [Integer, String, Symbol] 0-based column index or letter (e.g. 0 or “A” or :A). @param width [Float, Integer, nil] Column width in characters. @param hidden [Boolean] Whether the column is hidden. @param best_fit [Boolean] Whether the column automatically fits content. @param custom_width [Boolean] Whether to flag as custom width. @param outline_level [Integer, nil] Grouping/outline level (0 - 7). @param collapsed [Boolean] Whether the outline group is collapsed. @return [void] @api public
(String | Integer cell, String text, ?author: String) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 420 def comment(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.comment(...) end
Adds a comment to a cell.
@example
s.comment("A1", "Reviewed and approved", author: "Auditor")
@param cell [String, Integer] The cell reference (e.g. “A1”). @param text [String] The comment text. @param author [String] The author name. @return [void] @api public
(String range, ?type: String | Symbol, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 373 def conditional_format(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.conditional_format(...) end
Adds conditional formatting to a range.
@example Highlight values greater than 100
s.conditional_format("A1:A10", type: "cellIs", operator: "greaterThan", formula: 100, style: :highlight)
@param range [String] The cell range (e.g. “A1:A10”). @param type [String, Symbol] Rule type (“cellIs”, “colorScale”, “dataBar”, “expression”). @param opts [Hash] Rule options. @return [void] @api public
(String | Symbol name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 599 def core_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.core_property(...) end
simplecov:disable Edge case / untested delegation block Sets core metadata property.
@param name [String, Symbol] Property name. @param value [Object] Property value. @return [void] @api public
(String | Symbol name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 730 def custom_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.custom_property(...) end
simplecov:disable Edge case / untested delegation block Sets custom metadata property.
@param name [String, Symbol] Property name. @param value [Object] Property value. @return [void] @api public
(String name, String formula, ?sheet_id: Integer | nil, ?hidden: bool) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 503 def defined_name(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.defined_name(...) end
Adds a defined named range or formula.
@example
s.defined_name("TaxRate", "0.10")
@param name [String] The name. @param formula [String] The formula or range expression. @param sheet_id [Integer, nil] Optional sheet scope. @param hidden [Boolean] Whether the name is hidden. @return [void] @api public
(Integer col_id, Array[String] | Hash[Symbol, untyped] filter_values) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 322 def filter_column(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.filter_column(...) end
Sets filter criteria for a column in the auto-filter.
@example Simple values filter
s.filter_column(0, ["Active", "Pending"])
@param col_id [Integer] 0-based column index relative to auto-filter range. @param filter_values [Array<String>, Hash] Values or filter specification hash. @return [void] @api public
(?row: Integer | nil, ?col: Integer | nil) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 522 def freeze_pane(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.freeze_pane(...) end
Freezes rows and/or columns for scrolling.
@example Freeze top row
s.freeze_pane(row: 1)
@example Freeze first column and top 2 rows
s.freeze_pane(row: 2, col: 1)
@param row [Integer, nil] Number of rows to freeze. @param col [Integer, nil] Number of columns to freeze. @return [void] @api public
(String cell, ?String? url, ?display: String?, ?tooltip: String?, ?location: String?) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 291 def hyperlink(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.hyperlink(...) end
Adds a hyperlink to a cell.
@example Positional URL
s.hyperlink("A1", "https://example.com", display: "Example")
@example Keyword location
s.hyperlink("A1", location: "https://example.com", tooltip: "Go to Example")
@param cell [String] The cell reference (e.g. “A1”). @param url [String, nil] The target URL or URI. @param display [String, nil] Display text for the link. @param tooltip [String, nil] Tooltip text when hovering. @param location [String, nil] Destination location / URL (keyword alternative). @return [void] @api public
(String file_data, ?ext: String, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 749 def image(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.image(...) end
Inserts an image into the sheet.
@param file_data [String] Binary image data or file content. @param ext [String] Image extension (“png”, “jpeg”, etc.). @param from_col [Integer] Starting column index (0-based). @param from_row [Integer] Starting row index (0-based). @param to_col [Integer] Ending column index (0-based). @param to_row [Integer] Ending row index (0-based). @param opts [Hash] Additional anchor and sizing options. @return [void] @api public
(*untyped args, **untyped kwargs) ?{ (*untyped) → untyped } → untyped
Source
# File lib/xlsxrb/stream_writer.rb, line 202 def internal_sheet_setup(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.internal_sheet_setup(...) end
simplecov:disable Edge case / untested delegation block
(?String? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 172 def merge(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.merge(...) end
Merges a range of cells into a single cell.
@example Merge with cell reference string
s.merge("A1:C1")
@example Merge with coordinates
s.merge(row: 0, col_start: 0, col_end: 2)
@param range [String, nil] The cell range (e.g. “A1:B2”). @param row [Integer, nil] 0-based row index. @param col_start [Integer, String, nil] 0-based start column index or letter. @param col_end [Integer, String, nil] 0-based end column index or letter. @param row_start [Integer, nil] 0-based start row index. @param row_end [Integer, nil] 0-based end row index. @return [void] @api public
(Integer col_index) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 791 def page_break_col(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_break_col(...) end
simplecov:disable Edge case / untested delegation block Adds a vertical page break after the given column index.
@param col_index [Integer] 0-based column index. @return [void] @api public
(Integer row_index) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 776 def page_break_row(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_break_row(...) end
simplecov:disable Edge case / untested delegation block Adds a horizontal page break after the given row index.
@param row_index [Integer] 0-based row index. @return [void] @api public
(?left: Float | nil, ?right: Float | nil, ?top: Float | nil, ?bottom: Float | nil, ?header: Float | nil, ?footer: Float | nil) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 631 def page_margins(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_margins(...) end
Configures page margins for printing.
@param left [Float, nil] Left margin in inches. @param right [Float, nil] Right margin in inches. @param top [Float, nil] Top margin in inches. @param bottom [Float, nil] Bottom margin in inches. @param header [Float, nil] Header margin in inches. @param footer [Float, nil] Footer margin in inches. @return [void] @api public
(?orientation: (String | Symbol)?, ?paper_size: Integer | nil, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 645 def page_setup(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_setup(...) end
Configures page orientation, paper size, and print setup.
@param orientation [String, Symbol, nil] “portrait” or “landscape” (or :portrait, :landscape). @param paper_size [Integer, nil] Paper size index (e.g. 9 for A4, 1 for Letter). @param opts [Hash] Additional options (scale, fit_to_width, fit_to_height). @return [void] @api public
(String source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: String, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 440 def pivot_table(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.pivot_table(...) end
Adds a Pivot Table to the sheet.
@param source_ref [String] Source data range reference (e.g. “Sheet1!A1:D100”). @param row_fields [Array<String>] Field names for rows. @param data_fields [Array<String>] Field names for data values. @param col_fields [Array<String>] Field names for columns. @param dest_ref [String] Target top-left cell reference (default: “E1”). @param name [String, nil] Pivot table name. @param field_names [Array<String>, nil] Override field names. @param items [Array, nil] Items configuration. @param opts [Hash] Additional options. @return [void] @api public
(String ref) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 536 def print_area(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_area(...) end
simplecov:disable Edge case / untested delegation block Sets the print area range for the sheet.
@param ref [String] Range reference. @return [void] @api public
(Symbol | String name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 670 def print_options(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_options(...) end
Configures print options (e.g. gridlines, headings).
@param name [Symbol, String] Print option name. @param value [Object] Print option value. @return [void] @api public
(?rows: String?, ?cols: String?) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 552 def print_titles(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_titles(...) end
simplecov:disable Edge case / untested delegation block Configures repeating title rows and columns for printing.
@param rows [String, nil] Row range to repeat (e.g. “1:2”). @param cols [String, nil] Column range to repeat (e.g. “A:B”). @return [void] @api public
(?core: Hash[untyped, untyped]?, ?app: Hash[untyped, untyped]?, ?custom: Hash[untyped, untyped]?) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 686 def properties(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.properties(...) end
simplecov:disable Edge case / untested delegation block Sets document metadata properties (core, app, custom).
@param core [Hash, nil] Core properties (title, creator, subject, etc.). @param app [Hash, nil] App properties (company, manager). @param custom [Hash, nil] Custom properties. @return [void] @api public
(**untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 715 def protect_sheet(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_sheet(...) end
Protects the worksheet against modifications.
@param opts [Hash] Protection options. @return [void] @api public
(**untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 583 def protect_workbook(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_workbook(...) end
simplecov:disable Edge case / untested delegation block Protects the workbook structure.
@param opts [Hash] Protection options. @return [void] @api public
(Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?outline_level: Integer | nil) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 226 def row(values, styles: nil, height: nil, hidden: false, custom_height: false, outline_level: nil) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.row(values, styles: styles, height: height, hidden: hidden, custom_height: custom_height, outline_level: outline_level) end
Appends a row of cells to the active sheet.
@example Write an array of values
s.row(["Name", "Age", "City"])
@example Write with explicit column keys and styles
s.row({ A: "Header", C: 100 }, styles: { A: :bold })
@param values [Array, Hash] The cell values (e.g. ‘[1, 2, 3]` or `{ A: 1, C: 3 }`). @param styles [String, Symbol, Array, Hash, nil] Style names or hashes to apply. @param height [Float, Integer, nil] The row height in points (0 - 409). @param hidden [Boolean] Whether the row is hidden. @param custom_height [Boolean] Whether to flag as custom height. @param outline_level [Integer, nil] Grouping/outline level (0 - 7). @return [void] @api public
(String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 614 def select_cell(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.select_cell(...) end
Sets the active/selected cell on the sheet.
@param active_cell [String] Cell reference (e.g. “A1”). @param sqref [String, nil] Selection range. @param pane [String, Symbol, nil] Pane identifier. @return [void] @api public
(?preset: String, ?text: String?, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 193 def shape(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.shape(...) end
Adds a drawing shape to the sheet.
@example
s.shape(preset: "ellipse", text: "Circle", from_col: 1, from_row: 1, to_col: 4, to_row: 5)
@param preset [String] Preset shape type (e.g. “rect”, “ellipse”). @param text [String, nil] Shape label text. @param from_col [Integer] Starting column index (0-based). @param from_row [Integer] Starting row index (0-based). @param to_col [Integer] Ending column index (0-based). @param to_row [Integer] Ending row index (0-based). @param opts [Hash] Additional shape formatting options. @return [void] @api public
(Symbol | String name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 485 def sheet_properties(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_properties(...) end
Sets sheet properties (e.g. tab color, page setup flags).
@example
s.sheet_properties(:tab_color, "FF0000")
@param name [Symbol, String] Property name. @param value [Object] Property value. @return [void] @api public
(Symbol | String name, untyped value) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 762 def sheet_view(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_view(...) end
Configures sheet view settings (zoom scale, grid lines visibility).
@param name [Symbol, String] View setting name. @param value [Object] View setting value. @return [void] @api public
(String ref, Array[Hash[Symbol, untyped]] | Hash[Symbol, untyped] sort_conditions, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 339 def sort_state(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sort_state(...) end
Configures sort state on a range.
@example
s.sort_state("A1:A10", [{ ref: "A1:A10", descending: true }])
@param ref [String] The range to sort. @param sort_conditions [Array<Hash>, Hash] Sort conditions array or options hash. @param opts [Hash] Additional sort options. @return [void] @api public
(sparklines: Array[Hash[Symbol, untyped]], ?type: (String | Symbol)?, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 457 def sparkline_group(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sparkline_group(...) end
Adds sparklines to the sheet.
@example
s.sparkline_group(sparklines: [{ data_ref: "A1:E1", location_ref: "F1" }], type: "line")
@param sparklines [Array<Hash>] Array of { data_ref:, location_ref: } hashes. @param type [String, Symbol, nil] “line” (default), “column”, or “stacked”. @param opts [Hash] Additional sparkline options. @return [void] @api public
(?x_split: Numeric | nil, ?y_split: Numeric | nil, ?top_left_cell: String?, ?active_pane: String?, ?state: String?) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 569 def split_pane(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.split_pane(...) end
Splits sheet view into panes.
@param x_split [Numeric, nil] Horizontal split position. @param y_split [Numeric, nil] Vertical split position. @param top_left_cell [String, nil] Top-left visible cell in bottom-right pane. @param active_pane [String, nil] Active pane identifier. @param state [String, nil] Split state. @return [void] @api public
(String | Symbol name, **untyped opts) ?{ (Xlsxrb::StyleBuilder) → void } → Xlsxrb::StyleBuilder
Source
# File lib/xlsxrb/stream_writer.rb, line 149 def style(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.style(...) end
Defines or configures a named cell style on the active sheet.
@example
s.style(:header, bold: true, fill_color: "4F81BD", font_color: "FFFFFF")
@param name [String, Symbol] The name of the style. @param opts [Hash] Style options (e.g. bold: true, fill_color: “FF0000”). @yield [style_builder] @yieldparam style_builder [Xlsxrb::StyleBuilder] @return [Xlsxrb::StyleBuilder] @api public
(String ref, columns: untyped, ?name: String?, ?display_name: String?, ?style: String?, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 393 def table(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.table(...) end
Adds a formatted Excel Table to the sheet.
@example
s.table("A1:C10", columns: ["ID", "Name", "Total"], name: "SalesTable", style: "TableStyleMedium9")
@param ref [String] The cell range for the table (e.g. “A1:D10”). @param columns [Array<String>, Array<Hash>] Column names or definitions. @param name [String, nil] Table name. @param display_name [String, nil] Display name. @param style [String, nil] Table style name. @param opts [Hash] Additional options. @return [void] @api public
(String range, ?type: String | Symbol, **untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 356 def validate_data(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.validate_data(...) end
Adds data validation rules to a range.
@example Dropdown list validation
s.validate_data("B2:B100", type: "list", formula1: '"High,Medium,Low"')
@param range [String] The cell range (e.g. “B2:B10”). @param type [String, Symbol] Validation type (“list”, “whole”, “decimal”, “date”, “time”, “textLength”, “custom”). @param opts [Hash] Validation options. @return [void] @api public
(**untyped opts) → void
Source
# File lib/xlsxrb/stream_writer.rb, line 469 def workbook_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.workbook_property(...) end
Sets workbook-level properties.
@param opts [Hash] Workbook property options. @return [void] @api public