Class: Xlsxrb::StreamWriter::WorksheetProxy
- Inherits:
-
Object
- Object
- Xlsxrb::StreamWriter::WorksheetProxy
- Defined in:
- lib/xlsxrb.rb,
sig/generated/xlsxrb.rbs
Overview
Proxy object yielded by the sheet method to prevent writing to inactive sheets.
Instance Method Summary collapse
-
#app_property ⇒ void
simplecov:disable Edge case / untested delegation block Set app metadata property.
-
#auto_filter ⇒ void
Set the auto-filter range on the sheet.
-
#chart {|chart_builder| ... } ⇒ void
Add a chart to the sheet.
-
#cleanup! ⇒ void
simplecov:disable Edge case / untested delegation block : () -> void.
-
#column ⇒ void
Configure column width and properties.
-
#comment ⇒ void
Add a comment to a cell.
-
#conditional_format ⇒ void
Add conditional formatting to a range.
-
#core_property ⇒ void
simplecov:disable Edge case / untested delegation block Set core metadata property.
-
#custom_property ⇒ void
simplecov:disable Edge case / untested delegation block Set custom metadata property.
-
#defined_name ⇒ void
Add a defined named range or formula.
-
#filter_column ⇒ void
Set filter criteria for a column in the auto-filter.
-
#freeze_pane ⇒ void
Freeze rows and/or columns for scrolling.
-
#header_footer ⇒ void
Configure header and footer text for printing.
-
#hyperlink ⇒ void
Add a hyperlink to a cell.
-
#image ⇒ void
Insert an image into the sheet.
-
#initialize(writer, sheet_name) ⇒ WorksheetProxy
constructor
A new instance of WorksheetProxy.
-
#internal_sheet_setup ⇒ void
simplecov:disable Edge case / untested delegation block : (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped.
-
#merge ⇒ void
Merge a range of cells.
-
#page_break_col ⇒ void
simplecov:disable Edge case / untested delegation block Add a vertical page break after the given column index.
-
#page_break_row ⇒ void
simplecov:disable Edge case / untested delegation block Add a horizontal page break after the given row index.
-
#page_margins ⇒ void
Configure page margins for printing.
-
#page_setup ⇒ void
Configure page orientation, paper size, and print setup.
-
#pivot_table ⇒ void
Add a Pivot Table to the sheet.
-
#print_area ⇒ void
simplecov:disable Edge case / untested delegation block Set the print area range for the sheet.
-
#print_options ⇒ void
Configure print options (e.g. gridlines, headings).
-
#print_titles ⇒ void
simplecov:disable Edge case / untested delegation block Configure repeating title rows and columns for printing.
-
#properties ⇒ void
simplecov:disable Edge case / untested delegation block Set document metadata properties (core, app, custom).
-
#protect_sheet ⇒ void
Protect the worksheet against modifications.
-
#protect_workbook ⇒ void
simplecov:disable Edge case / untested delegation block Protect the workbook structure.
-
#row ⇒ void
Add a row to the active sheet.
-
#select_cell ⇒ void
Set the active/selected cell on the sheet.
-
#shape ⇒ void
Add a drawing shape to the sheet.
-
#sheet_properties ⇒ void
Set sheet properties (e.g. tab color, page setup flags).
-
#sheet_view ⇒ void
Configure sheet view settings (zoom scale, grid lines visibility).
-
#sort_state ⇒ void
Configure sort state on a range.
-
#sparkline_group ⇒ void
Add sparklines to the sheet.
-
#split_pane ⇒ void
Split sheet view into panes.
-
#style {|style_builder| ... } ⇒ Xlsxrb::StyleBuilder
Define or configure a named cell style.
-
#table ⇒ void
Add a formatted Excel Table to the sheet.
-
#validate_data ⇒ void
Add data validation rules to a range.
-
#workbook_property ⇒ void
Set workbook-level properties.
Constructor Details
#initialize(writer, sheet_name) ⇒ WorksheetProxy
Returns a new instance of WorksheetProxy.
1835 1836 1837 1838 |
# File 'lib/xlsxrb.rb', line 1835 def initialize(writer, sheet_name) @writer = writer @sheet_name = sheet_name end |
Instance Method Details
#app_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Set app metadata property.
: (String | Symbol name, untyped value) -> void
2438 2439 2440 2441 2442 |
# File 'lib/xlsxrb.rb', line 2438 def app_property(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.app_property(...) end |
#auto_filter ⇒ void
This method returns an undefined value.
Set the auto-filter range on the sheet.
: (String ref) -> void
2008 2009 2010 2011 2012 |
# File 'lib/xlsxrb.rb', line 2008 def auto_filter(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.auto_filter(...) end |
#chart {|chart_builder| ... } ⇒ void
This method returns an undefined value.
Add a chart to the sheet.
: (?Symbol | String? type, **untyped opts) ?{ (Xlsxrb::ChartBuilder) -> void } -> void
1971 1972 1973 1974 1975 |
# File 'lib/xlsxrb.rb', line 1971 def chart(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.chart(...) end |
#cleanup! ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block : () -> void
2110 2111 2112 2113 2114 |
# File 'lib/xlsxrb.rb', line 2110 def cleanup!(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.cleanup!(...) end |
#column ⇒ void
This method returns an undefined value.
Configure column width and properties.
: (Integer | String | Symbol col_index, ?width: Float | Integer | nil, ?hidden: bool, ?best_fit: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool) -> void
1950 1951 1952 1953 1954 |
# File 'lib/xlsxrb.rb', line 1950 def column(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.column(...) end |
#comment ⇒ void
This method returns an undefined value.
Add a comment to a cell.
: (String | Integer cell, String text, ?author: String) -> void
2128 2129 2130 2131 2132 |
# File 'lib/xlsxrb.rb', line 2128 def comment(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.comment(...) end |
#conditional_format ⇒ void
This method returns an undefined value.
Add conditional formatting to a range.
: (String range, ?type: String | Symbol, **untyped opts) -> void
2081 2082 2083 2084 2085 |
# File 'lib/xlsxrb.rb', line 2081 def conditional_format(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.conditional_format(...) end |
#core_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Set core metadata property.
: (String | Symbol name, untyped value) -> void
2316 2317 2318 2319 2320 |
# File 'lib/xlsxrb.rb', line 2316 def core_property(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.core_property(...) end |
#custom_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Set custom metadata property.
: (String | Symbol name, untyped value) -> void
2469 2470 2471 2472 2473 |
# File 'lib/xlsxrb.rb', line 2469 def custom_property(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.custom_property(...) end |
#defined_name ⇒ void
This method returns an undefined value.
Add a defined named range or formula.
: (String name, String formula, ?sheet_id: Integer | nil, ?hidden: bool) -> void
2214 2215 2216 2217 2218 |
# File 'lib/xlsxrb.rb', line 2214 def defined_name(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.defined_name(...) end |
#filter_column ⇒ void
This method returns an undefined value.
Set filter criteria for a column in the auto-filter.
: (Integer col_id, Array | Hash[Symbol, untyped] filter_values) -> void
2027 2028 2029 2030 2031 |
# File 'lib/xlsxrb.rb', line 2027 def filter_column(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.filter_column(...) end |
#freeze_pane ⇒ void
This method returns an undefined value.
Freeze rows and/or columns for scrolling.
: (?row: Integer | nil, ?col: Integer | nil) -> void
2233 2234 2235 2236 2237 |
# File 'lib/xlsxrb.rb', line 2233 def freeze_pane(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.freeze_pane(...) end |
#header_footer ⇒ void
This method returns an undefined value.
Configure header and footer text for printing.
: (**untyped opts) -> void
2387 2388 2389 2390 2391 |
# File 'lib/xlsxrb.rb', line 2387 def (...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.(...) end |
#hyperlink ⇒ void
This method returns an undefined value.
Add a hyperlink to a cell.
: (String cell, ?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> void
1993 1994 1995 1996 1997 |
# File 'lib/xlsxrb.rb', line 1993 def hyperlink(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.hyperlink(...) end |
#image ⇒ void
This method returns an undefined value.
Insert an image into the sheet.
: (String file_data, ?ext: String, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
2491 2492 2493 2494 2495 |
# File 'lib/xlsxrb.rb', line 2491 def image(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.image(...) end |
#internal_sheet_setup ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block : (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
1905 1906 1907 1908 1909 |
# File 'lib/xlsxrb.rb', line 1905 def internal_sheet_setup(...) raise Error, "Sheet '' 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 |
#merge ⇒ void
This method returns an undefined value.
Merge a range of cells.
: (?String? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
1875 1876 1877 1878 1879 |
# File 'lib/xlsxrb.rb', line 1875 def merge(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.merge(...) end |
#page_break_col ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Add a vertical page break after the given column index.
: (Integer col_index) -> void
2543 2544 2545 2546 2547 |
# File 'lib/xlsxrb.rb', line 2543 def page_break_col(...) raise Error, "Sheet '' 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 |
#page_break_row ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Add a horizontal page break after the given row index.
: (Integer row_index) -> void
2525 2526 2527 2528 2529 |
# File 'lib/xlsxrb.rb', line 2525 def page_break_row(...) raise Error, "Sheet '' 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 |
#page_margins ⇒ void
This method returns an undefined value.
Configure page margins for printing.
: (?left: Float | nil, ?right: Float | nil, ?top: Float | nil, ?bottom: Float | nil, ?header: Float | nil, ?footer: Float | nil) -> void
2355 2356 2357 2358 2359 |
# File 'lib/xlsxrb.rb', line 2355 def page_margins(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_margins(...) end |
#page_setup ⇒ void
This method returns an undefined value.
Configure page orientation, paper size, and print setup.
: (?orientation: (String | Symbol)?, ?paper_size: Integer | nil, **untyped opts) -> void
2372 2373 2374 2375 2376 |
# File 'lib/xlsxrb.rb', line 2372 def page_setup(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_setup(...) end |
#pivot_table ⇒ void
This method returns an undefined value.
Add a Pivot Table to the sheet.
: (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
2151 2152 2153 2154 2155 |
# File 'lib/xlsxrb.rb', line 2151 def pivot_table(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.pivot_table(...) end |
#print_area ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Set the print area range for the sheet.
: (String ref) -> void
2250 2251 2252 2253 2254 |
# File 'lib/xlsxrb.rb', line 2250 def print_area(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_area(...) end |
#print_options ⇒ void
This method returns an undefined value.
Configure print options (e.g. gridlines, headings).
: (Symbol | String name, untyped value) -> void
2403 2404 2405 2406 2407 |
# File 'lib/xlsxrb.rb', line 2403 def (...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.(...) end |
#print_titles ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Configure repeating title rows and columns for printing.
: (?rows: String?, ?cols: String?) -> void
2269 2270 2271 2272 2273 |
# File 'lib/xlsxrb.rb', line 2269 def print_titles(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_titles(...) end |
#properties ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Set document metadata properties (core, app, custom).
: (?core: Hash[untyped, untyped]?, ?app: Hash[untyped, untyped]?, ?custom: Hash[untyped, untyped]?) -> void
2422 2423 2424 2425 2426 |
# File 'lib/xlsxrb.rb', line 2422 def properties(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.properties(...) end |
#protect_sheet ⇒ void
This method returns an undefined value.
Protect the worksheet against modifications.
: (**untyped opts) -> void
2454 2455 2456 2457 2458 |
# File 'lib/xlsxrb.rb', line 2454 def protect_sheet(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_sheet(...) end |
#protect_workbook ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Protect the workbook structure.
: (**untyped opts) -> void
2300 2301 2302 2303 2304 |
# File 'lib/xlsxrb.rb', line 2300 def protect_workbook(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_workbook(...) end |
#row ⇒ void
This method returns an undefined value.
Add a row to the active sheet.
: (Array | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?outline_level: Integer | nil) -> void
1929 1930 1931 1932 1933 |
# File 'lib/xlsxrb.rb', line 1929 def row(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.row(...) end |
#select_cell ⇒ void
This method returns an undefined value.
Set the active/selected cell on the sheet.
: (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
2335 2336 2337 2338 2339 |
# File 'lib/xlsxrb.rb', line 2335 def select_cell(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.select_cell(...) end |
#shape ⇒ void
This method returns an undefined value.
Add a drawing shape to the sheet.
: (?preset: String, ?text: String?, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
1896 1897 1898 1899 1900 |
# File 'lib/xlsxrb.rb', line 1896 def shape(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.shape(...) end |
#sheet_properties ⇒ void
This method returns an undefined value.
Set sheet properties (e.g. tab color, page setup flags).
: (Symbol | String name, untyped value) -> void
2196 2197 2198 2199 2200 |
# File 'lib/xlsxrb.rb', line 2196 def sheet_properties(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_properties(...) end |
#sheet_view ⇒ void
This method returns an undefined value.
Configure sheet view settings (zoom scale, grid lines visibility).
: (Symbol | String name, untyped value) -> void
2508 2509 2510 2511 2512 |
# File 'lib/xlsxrb.rb', line 2508 def sheet_view(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_view(...) end |
#sort_state ⇒ void
This method returns an undefined value.
Configure sort state on a range.
: (String ref, Array[Hash[Symbol, untyped]] | Hash[Symbol, untyped] sort_conditions, **untyped opts) -> void
2044 2045 2046 2047 2048 |
# File 'lib/xlsxrb.rb', line 2044 def sort_state(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sort_state(...) end |
#sparkline_group ⇒ void
This method returns an undefined value.
Add sparklines to the sheet.
: (sparklines: Array[Hash[Symbol, untyped]], ?type: String?, **untyped opts) -> void
2168 2169 2170 2171 2172 |
# File 'lib/xlsxrb.rb', line 2168 def sparkline_group(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sparkline_group(...) end |
#split_pane ⇒ void
This method returns an undefined value.
Split sheet view into panes.
: (?x_split: Numeric | nil, ?y_split: Numeric | nil, ?top_left_cell: String?, ?active_pane: String?, ?state: String?) -> void
2286 2287 2288 2289 2290 |
# File 'lib/xlsxrb.rb', line 2286 def split_pane(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.split_pane(...) end |
#style {|style_builder| ... } ⇒ Xlsxrb::StyleBuilder
Define or configure a named cell style.
: (String | Symbol name, **untyped opts) ?{ (Xlsxrb::StyleBuilder) -> void } -> Xlsxrb::StyleBuilder
1852 1853 1854 1855 1856 |
# File 'lib/xlsxrb.rb', line 1852 def style(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.style(...) end |
#table ⇒ void
This method returns an undefined value.
Add a formatted Excel Table to the sheet.
: (String ref, columns: untyped, ?name: String?, ?display_name: String?, ?style: String?, **untyped opts) -> void
2101 2102 2103 2104 2105 |
# File 'lib/xlsxrb.rb', line 2101 def table(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.table(...) end |
#validate_data ⇒ void
This method returns an undefined value.
Add data validation rules to a range.
: (String range, ?type: String | Symbol, **untyped opts) -> void
2064 2065 2066 2067 2068 |
# File 'lib/xlsxrb.rb', line 2064 def validate_data(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.validate_data(...) end |
#workbook_property ⇒ void
This method returns an undefined value.
Set workbook-level properties.
: (**untyped opts) -> void
2180 2181 2182 2183 2184 |
# File 'lib/xlsxrb.rb', line 2180 def workbook_property(...) raise Error, "Sheet '' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.workbook_property(...) end |