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.
1686 1687 1688 1689 |
# File 'lib/xlsxrb.rb', line 1686 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
2289 2290 2291 2292 2293 |
# File 'lib/xlsxrb.rb', line 2289 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
1859 1860 1861 1862 1863 |
# File 'lib/xlsxrb.rb', line 1859 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
1822 1823 1824 1825 1826 |
# File 'lib/xlsxrb.rb', line 1822 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
1961 1962 1963 1964 1965 |
# File 'lib/xlsxrb.rb', line 1961 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
1801 1802 1803 1804 1805 |
# File 'lib/xlsxrb.rb', line 1801 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
1979 1980 1981 1982 1983 |
# File 'lib/xlsxrb.rb', line 1979 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
1932 1933 1934 1935 1936 |
# File 'lib/xlsxrb.rb', line 1932 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
2167 2168 2169 2170 2171 |
# File 'lib/xlsxrb.rb', line 2167 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
2320 2321 2322 2323 2324 |
# File 'lib/xlsxrb.rb', line 2320 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
2065 2066 2067 2068 2069 |
# File 'lib/xlsxrb.rb', line 2065 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
1878 1879 1880 1881 1882 |
# File 'lib/xlsxrb.rb', line 1878 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
2084 2085 2086 2087 2088 |
# File 'lib/xlsxrb.rb', line 2084 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
2238 2239 2240 2241 2242 |
# File 'lib/xlsxrb.rb', line 2238 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
1844 1845 1846 1847 1848 |
# File 'lib/xlsxrb.rb', line 1844 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
2342 2343 2344 2345 2346 |
# File 'lib/xlsxrb.rb', line 2342 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
1756 1757 1758 1759 1760 |
# File 'lib/xlsxrb.rb', line 1756 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
1726 1727 1728 1729 1730 |
# File 'lib/xlsxrb.rb', line 1726 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
2394 2395 2396 2397 2398 |
# File 'lib/xlsxrb.rb', line 2394 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
2376 2377 2378 2379 2380 |
# File 'lib/xlsxrb.rb', line 2376 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
2206 2207 2208 2209 2210 |
# File 'lib/xlsxrb.rb', line 2206 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
2223 2224 2225 2226 2227 |
# File 'lib/xlsxrb.rb', line 2223 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
2002 2003 2004 2005 2006 |
# File 'lib/xlsxrb.rb', line 2002 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
2101 2102 2103 2104 2105 |
# File 'lib/xlsxrb.rb', line 2101 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
2254 2255 2256 2257 2258 |
# File 'lib/xlsxrb.rb', line 2254 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
2120 2121 2122 2123 2124 |
# File 'lib/xlsxrb.rb', line 2120 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
2273 2274 2275 2276 2277 |
# File 'lib/xlsxrb.rb', line 2273 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
2305 2306 2307 2308 2309 |
# File 'lib/xlsxrb.rb', line 2305 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
2151 2152 2153 2154 2155 |
# File 'lib/xlsxrb.rb', line 2151 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
1780 1781 1782 1783 1784 |
# File 'lib/xlsxrb.rb', line 1780 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
2186 2187 2188 2189 2190 |
# File 'lib/xlsxrb.rb', line 2186 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
1747 1748 1749 1750 1751 |
# File 'lib/xlsxrb.rb', line 1747 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
2047 2048 2049 2050 2051 |
# File 'lib/xlsxrb.rb', line 2047 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
2359 2360 2361 2362 2363 |
# File 'lib/xlsxrb.rb', line 2359 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
1895 1896 1897 1898 1899 |
# File 'lib/xlsxrb.rb', line 1895 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
2019 2020 2021 2022 2023 |
# File 'lib/xlsxrb.rb', line 2019 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
2137 2138 2139 2140 2141 |
# File 'lib/xlsxrb.rb', line 2137 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
1703 1704 1705 1706 1707 |
# File 'lib/xlsxrb.rb', line 1703 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
1952 1953 1954 1955 1956 |
# File 'lib/xlsxrb.rb', line 1952 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
1915 1916 1917 1918 1919 |
# File 'lib/xlsxrb.rb', line 1915 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
2031 2032 2033 2034 2035 |
# File 'lib/xlsxrb.rb', line 2031 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 |