summaryrefslogtreecommitdiffhomepage
path: root/examples/auto_filter.rb
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/auto_filter.rb
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/auto_filter.rb')
-rw-r--r--examples/auto_filter.rb16
1 files changed, 16 insertions, 0 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')