diff options
| author | Randy Morgan <[email protected]> | 2012-06-20 19:26:25 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-06-20 19:26:25 +0900 |
| commit | 3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2 (patch) | |
| tree | d22cda14d33f15646a54195abb7b709741650a47 /examples | |
| parent | eb9e1495c31b74ade95cce3b9e5e4c420d66eb02 (diff) | |
| download | caxlsx-3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2.tar.gz caxlsx-3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2.zip | |
update examples and the beginings of protected_range
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/example.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/example.rb b/examples/example.rb index 4287dff9..5b5b11b9 100755 --- a/examples/example.rb +++ b/examples/example.rb @@ -334,6 +334,14 @@ end #``` +# Sheet Protection and excluding cells from locking. +unlocked = wb.styles.add_style :locked => false +wb.add_worksheet(:name => 'Sheet Protection') do |sheet| + sheet.sheet_protection.password = 'fish' + sheet.add_row [1, 2 ,3] # These cells will be locked + sheet.add_row [4, 5, 6], :style => unlocked # these cells will not! +end + ##Specify page margins and other options for printing #```ruby @@ -355,7 +363,7 @@ end ## Frozen/Split panes ## ``` ruby wb.add_worksheet(:name => 'fixed headers') do |sheet| - sheet.add_row(['', (0..99).map { |i| "column header #{i}" }].flatten ) + sheet.add_row(['', (0..99).map { |i| "column header #{i}" }].flatten ) 100.times.with_index { |index| sheet << ["row header", (0..index).to_a].flatten } sheet.sheet_view.pane do |pane| pane.top_left_cell = "B2" |
