diff options
| author | Randy Morgan (@morgan_randy) <[email protected]> | 2013-09-28 21:32:51 -0700 |
|---|---|---|
| committer | Randy Morgan (@morgan_randy) <[email protected]> | 2013-09-28 21:32:51 -0700 |
| commit | b59466fa647d1d8ded05e724d14de05d83a64092 (patch) | |
| tree | 173692234de961c220b7086dcaf70c09fa9d0348 /examples | |
| parent | ce9819fcb2f9807ff1e9e68918e921f62aad2148 (diff) | |
| parent | 09c9170e50ed4550015e34fdb54b7433bee0ef40 (diff) | |
| download | caxlsx-b59466fa647d1d8ded05e724d14de05d83a64092.tar.gz caxlsx-b59466fa647d1d8ded05e724d14de05d83a64092.zip | |
Merge pull request #250 from randym/bookview_sheetstate
Managing Sheet Visibility and Tab Selection
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/example.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/examples/example.rb b/examples/example.rb index 4960ce9f..8b11cb20 100755 --- a/examples/example.rb +++ b/examples/example.rb @@ -40,14 +40,15 @@ examples << :printing examples << :header_footer examples << :comments examples << :panes +examples << :book_view examples << :sheet_view +examples << :hiding_sheets examples << :conditional_formatting examples << :streaming examples << :shared_strings examples << :no_autowidth examples << :cached_formula examples << :page_breaks - p = Axlsx::Package.new wb = p.workbook #``` @@ -644,7 +645,27 @@ if examples.include? :sheet_view end end +## Book Views +# +## Book views let you specify which sheet the show as active when the user opens the work book as well as a bunch of other +## tuning values for the UI @see Axlsx::WorkbookView +## ```ruby +if examples.include? :book_view + # when you open example.xml the second sheet is selected, and the horizontal scroll bar is much smaller showing more sheets + wb.add_view tab_ratio: 800, active_tab: 1 +end +## Hiding Sheets +## +## Sheets can be hidden with the state attribute +if examples.include? :hiding_sheets + wb.add_worksheet name: 'hidden', state: :hidden do |sheet| + sheet.add_row ['you cant see me!'] + end + wb.add_worksheet name: 'very hidden', state: :very_hidden do |sheet| + sheet.add_row ['you really cant see me!'] + end +end # conditional formatting # if examples.include? :conditional_formatting |
