summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/util/constants.rb
diff options
context:
space:
mode:
authorAlex Rothenberg <[email protected]>2012-11-27 09:53:30 -0500
committerAlex Rothenberg <[email protected]>2012-11-27 09:54:23 -0500
commit4560bd0a1b8b46bf4d8c0783f9fa12e8ceee714f (patch)
treef5e6d539c7b4962442509ab6a09b2b4c42e8eaa5 /lib/axlsx/util/constants.rb
parent2feca4f74f21e6a3e63bd3badd02267be4062047 (diff)
downloadcaxlsx-4560bd0a1b8b46bf4d8c0783f9fa12e8ceee714f.tar.gz
caxlsx-4560bd0a1b8b46bf4d8c0783f9fa12e8ceee714f.zip
Create a simple Pivot Table
* an example can be run with `ruby examples/pivot_table.rb` * right now you cannot set options on the pivot table to make it useful (coming soon...)
Diffstat (limited to 'lib/axlsx/util/constants.rb')
-rw-r--r--lib/axlsx/util/constants.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb
index 66434b87..437de6db 100644
--- a/lib/axlsx/util/constants.rb
+++ b/lib/axlsx/util/constants.rb
@@ -51,6 +51,10 @@ module Axlsx
# table rels namespace
TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
+ # pivot table rels namespace
+ PIVOT_TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"
+ PIVOT_TABLE_CACHE_DEFINITION_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"
+
# workbook rels namespace
WORKBOOK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
@@ -99,6 +103,12 @@ module Axlsx
# table content type
TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
+ # pivot table content type
+ PIVOT_TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"
+
+ # pivot table cache definition content type
+ PIVOT_TABLE_CACHE_DEFINITION_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
+
# workbook content type
WORKBOOK_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
@@ -208,6 +218,13 @@ module Axlsx
# drawing part
TABLE_PN = "tables/table%d.xml"
+ # pivot table parts
+ PIVOT_TABLE_PN = "pivotTables/pivotTable%d.xml"
+ PIVOT_TABLE_CACHE_DEFINITION_PN = "pivotCache/pivotCacheDefinition%d.xml"
+
+ # pivot table rels parts
+ PIVOT_TABLE_RELS_PN = "pivotTables/_rels/pivotTable%d.xml.rels"
+
# chart part
CHART_PN = "charts/chart%d.xml"
@@ -320,7 +337,7 @@ module Axlsx
# x1E Information Separator Two
# x1F Information Separator One
#
- # The following are not dealt with.
+ # The following are not dealt with.
# If you have this in your data, expect excel to blow up!
#
# x7F Delete
@@ -365,7 +382,7 @@ module Axlsx
# @see http://www.codetable.net/asciikeycodes
pattern = "[\x0-\x08\x0B\x0C\x0E-\x1F]"
pattern= pattern.respond_to?(:encode) ? pattern.encode('UTF-8') : pattern
-
+
# The regular expression used to remove control characters from worksheets
CONTROL_CHAR_REGEX = Regexp.new(pattern, 'n')