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.
1744 1745 1746 1747 |
# File 'lib/xlsxrb.rb', line 1744 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
2347 2348 2349 2350 2351 |
# File 'lib/xlsxrb.rb', line 2347 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
1917 1918 1919 1920 1921 |
# File 'lib/xlsxrb.rb', line 1917 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
1880 1881 1882 1883 1884 |
# File 'lib/xlsxrb.rb', line 1880 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
2019 2020 2021 2022 2023 |
# File 'lib/xlsxrb.rb', line 2019 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
1859 1860 1861 1862 1863 |
# File 'lib/xlsxrb.rb', line 1859 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
2037 2038 2039 2040 2041 |
# File 'lib/xlsxrb.rb', line 2037 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
1990 1991 1992 1993 1994 |
# File 'lib/xlsxrb.rb', line 1990 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
2225 2226 2227 2228 2229 |
# File 'lib/xlsxrb.rb', line 2225 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
2378 2379 2380 2381 2382 |
# File 'lib/xlsxrb.rb', line 2378 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
2123 2124 2125 2126 2127 |
# File 'lib/xlsxrb.rb', line 2123 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
1936 1937 1938 1939 1940 |
# File 'lib/xlsxrb.rb', line 1936 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
2142 2143 2144 2145 2146 |
# File 'lib/xlsxrb.rb', line 2142 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
2296 2297 2298 2299 2300 |
# File 'lib/xlsxrb.rb', line 2296 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
1902 1903 1904 1905 1906 |
# File 'lib/xlsxrb.rb', line 1902 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
2400 2401 2402 2403 2404 |
# File 'lib/xlsxrb.rb', line 2400 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
1814 1815 1816 1817 1818 |
# File 'lib/xlsxrb.rb', line 1814 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
1784 1785 1786 1787 1788 |
# File 'lib/xlsxrb.rb', line 1784 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
2452 2453 2454 2455 2456 |
# File 'lib/xlsxrb.rb', line 2452 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
2434 2435 2436 2437 2438 |
# File 'lib/xlsxrb.rb', line 2434 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
2264 2265 2266 2267 2268 |
# File 'lib/xlsxrb.rb', line 2264 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
2281 2282 2283 2284 2285 |
# File 'lib/xlsxrb.rb', line 2281 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
2060 2061 2062 2063 2064 |
# File 'lib/xlsxrb.rb', line 2060 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
2159 2160 2161 2162 2163 |
# File 'lib/xlsxrb.rb', line 2159 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
2312 2313 2314 2315 2316 |
# File 'lib/xlsxrb.rb', line 2312 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
2178 2179 2180 2181 2182 |
# File 'lib/xlsxrb.rb', line 2178 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
2331 2332 2333 2334 2335 |
# File 'lib/xlsxrb.rb', line 2331 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
2363 2364 2365 2366 2367 |
# File 'lib/xlsxrb.rb', line 2363 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
2209 2210 2211 2212 2213 |
# File 'lib/xlsxrb.rb', line 2209 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
1838 1839 1840 1841 1842 |
# File 'lib/xlsxrb.rb', line 1838 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
2244 2245 2246 2247 2248 |
# File 'lib/xlsxrb.rb', line 2244 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
1805 1806 1807 1808 1809 |
# File 'lib/xlsxrb.rb', line 1805 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
2105 2106 2107 2108 2109 |
# File 'lib/xlsxrb.rb', line 2105 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
2417 2418 2419 2420 2421 |
# File 'lib/xlsxrb.rb', line 2417 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
1953 1954 1955 1956 1957 |
# File 'lib/xlsxrb.rb', line 1953 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
2077 2078 2079 2080 2081 |
# File 'lib/xlsxrb.rb', line 2077 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
2195 2196 2197 2198 2199 |
# File 'lib/xlsxrb.rb', line 2195 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
1761 1762 1763 1764 1765 |
# File 'lib/xlsxrb.rb', line 1761 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
2010 2011 2012 2013 2014 |
# File 'lib/xlsxrb.rb', line 2010 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
1973 1974 1975 1976 1977 |
# File 'lib/xlsxrb.rb', line 1973 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
2089 2090 2091 2092 2093 |
# File 'lib/xlsxrb.rb', line 2089 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 |