diff options
| author | Randy Morgan <[email protected]> | 2012-04-23 09:38:57 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-23 09:38:57 +0900 |
| commit | e044cfd495d8d7335b44b48d91f1f63be41dad26 (patch) | |
| tree | 03a61c0d1b07473e6f4b0a722e103add530ac6b1 /examples | |
| parent | 372fb7b2fe3408e8aab9b1b4ae5285aa98a8a945 (diff) | |
| parent | a86acda991fda771ebc41011f9d7895bf46c8c1d (diff) | |
| download | caxlsx-e044cfd495d8d7335b44b48d91f1f63be41dad26.tar.gz caxlsx-e044cfd495d8d7335b44b48d91f1f63be41dad26.zip | |
Merge branch 'master' of github.com:randym/axlsx
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/example_conditional_formatting.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/example_conditional_formatting.rb b/examples/example_conditional_formatting.rb index 429b6fac..ab49d238 100644 --- a/examples/example_conditional_formatting.rb +++ b/examples/example_conditional_formatting.rb @@ -25,8 +25,8 @@ book.add_worksheet(:name => "Cell Is") do |ws| ws.add_row ["Q#{i}", 10000*((rows/2-i) * (rows/2-i)), "=100*B#{i}/SUM(B3:B#{rows+offset})"], :style=>[nil, money, percent] end -# Apply conditional formatting to range B4:B100 in the worksheet - ws.add_conditional_formatting("B4:B100", { :type => :cellIs, :operator => :greaterThan, :formula => "100000", :dxfId => profitable, :priority => 1 }) +# Apply conditional formatting to range B3:B100 in the worksheet + ws.add_conditional_formatting("B3:B100", { :type => :cellIs, :operator => :greaterThan, :formula => "100000", :dxfId => profitable, :priority => 1 }) end book.add_worksheet(:name => "Color Scale") do |ws| @@ -37,9 +37,9 @@ book.add_worksheet(:name => "Color Scale") do |ws| offset.upto(rows + offset) do |i| ws.add_row ["Q#{i}", 10000*((rows/2-i) * (rows/2-i)), "=100*B#{i}/SUM(B3:B#{rows+offset})"], :style=>[nil, money, percent] end -# Apply conditional formatting to range B4:B100 in the worksheet +# Apply conditional formatting to range B3:B100 in the worksheet color_scale = Axlsx::ColorScale.new - ws.add_conditional_formatting("B4:B100", { :type => :colorScale, :operator => :greaterThan, :formula => "100000", :dxfId => profitable, :priority => 1, :color_scale => color_scale }) + ws.add_conditional_formatting("B3:B100", { :type => :colorScale, :operator => :greaterThan, :formula => "100000", :dxfId => profitable, :priority => 1, :color_scale => color_scale }) end @@ -51,9 +51,9 @@ book.add_worksheet(:name => "Data Bar") do |ws| offset.upto(rows + offset) do |i| ws.add_row ["Q#{i}", 10000*((rows/2-i) * (rows/2-i)), "=100*B#{i}/SUM(B3:B#{rows+offset})"], :style=>[nil, money, percent] end -# Apply conditional formatting to range B4:B100 in the worksheet +# Apply conditional formatting to range B3:B100 in the worksheet data_bar = Axlsx::DataBar.new - ws.add_conditional_formatting("B4:B100", { :type => :dataBar, :dxfId => profitable, :priority => 1, :data_bar => data_bar }) + ws.add_conditional_formatting("B3:B100", { :type => :dataBar, :dxfId => profitable, :priority => 1, :data_bar => data_bar }) end book.add_worksheet(:name => "Icon Set") do |ws| @@ -64,9 +64,9 @@ book.add_worksheet(:name => "Icon Set") do |ws| offset.upto(rows + offset) do |i| ws.add_row ["Q#{i}", 10000*((rows/2-i) * (rows/2-i)), "=100*B#{i}/SUM(B3:B#{rows+offset})"], :style=>[nil, money, percent] end -# Apply conditional formatting to range B4:B100 in the worksheet +# Apply conditional formatting to range B3:B100 in the worksheet icon_set = Axlsx::IconSet.new - ws.add_conditional_formatting("B4:B100", { :type => :iconSet, :dxfId => profitable, :priority => 1, :icon_set => icon_set }) + ws.add_conditional_formatting("B3:B100", { :type => :iconSet, :dxfId => profitable, :priority => 1, :icon_set => icon_set }) end -p.serialize('example_differential_styling.xlsx') +p.serialize('example_conditional_formatting.xlsx') |
