summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-26 14:42:00 +0900
committerRandy Morgan <[email protected]>2012-09-26 14:42:00 +0900
commit7ae8e76838c5ccf921de032a8d7bfa6e1017d007 (patch)
tree5e16ff075e7b261b60c891097f25215fb24906ea /examples
parent178335010128df34a7d0a0a6492e3e9bf1e94b99 (diff)
downloadcaxlsx-7ae8e76838c5ccf921de032a8d7bfa6e1017d007.tar.gz
caxlsx-7ae8e76838c5ccf921de032a8d7bfa6e1017d007.zip
pre-release readme updates and more work on auto_filter preset values
Diffstat (limited to 'examples')
-rw-r--r--examples/auto_filter.rb16
-rwxr-xr-xexamples/example.rb4
2 files changed, 18 insertions, 2 deletions
diff --git a/examples/auto_filter.rb b/examples/auto_filter.rb
new file mode 100644
index 00000000..fcfe2e90
--- /dev/null
+++ b/examples/auto_filter.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby -w -s
+# -*- coding: utf-8 -*-
+
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+require 'axlsx'
+Axlsx::Package.new do |p|
+ p.workbook.add_worksheet(:name => "Table") do |sheet|
+ sheet.add_row ["Build Matrix"]
+ sheet.add_row ["Build", "Duration", "Finished", "Rvm"]
+ sheet.add_row ["19.1", "1 min 32 sec", "about 10 hours ago", "1.8.7"]
+ sheet.add_row ["19.2", "1 min 28 sec", "about 10 hours ago", "1.9.2"]
+ sheet.add_row ["19.3", "1 min 35 sec", "about 10 hours ago", "1.9.3"]
+ sheet.auto_filter = 'A2:D5'
+ sheet.auto_filter.add_column 3, :filters, :filter_items => ['1.9.2']
+ end
+end.serialize('auto_filter.xlsx')
diff --git a/examples/example.rb b/examples/example.rb
index 3af276d5..9ba1ab73 100755
--- a/examples/example.rb
+++ b/examples/example.rb
@@ -309,13 +309,13 @@ end
##Tables
#```ruby
-wb.add_worksheet(:name => "Table", :style_info => { :name => "TableStyleMedium23" }) do |sheet|
+wb.add_worksheet(:name => "Table") do |sheet|
sheet.add_row ["Build Matrix"]
sheet.add_row ["Build", "Duration", "Finished", "Rvm"]
sheet.add_row ["19.1", "1 min 32 sec", "about 10 hours ago", "1.8.7"]
sheet.add_row ["19.2", "1 min 28 sec", "about 10 hours ago", "1.9.2"]
sheet.add_row ["19.3", "1 min 35 sec", "about 10 hours ago", "1.9.3"]
- sheet.add_table "A2:D5", :name => 'Build Matrix'
+ sheet.add_table "A2:D5", :name => 'Build Matrix', :style_info => { :name => "TableStyleMedium23" }
end
#```