From 4d16bfc43780e5d3f7368625700b583e3e98217a Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 18:11:42 +0900 Subject: adding in row_style and col_style methods to worksheet and active record 'acts_as_axlsx' to provide to_xlsx. --- doc/Axlsx/Workbook.html | 362 +++++++++++++++++++++++++++--------------------- 1 file changed, 207 insertions(+), 155 deletions(-) (limited to 'doc/Axlsx/Workbook.html') diff --git a/doc/Axlsx/Workbook.html b/doc/Axlsx/Workbook.html index 69e4e8e0..ffb0522c 100644 --- a/doc/Axlsx/Workbook.html +++ b/doc/Axlsx/Workbook.html @@ -94,31 +94,33 @@

Overview

- -

The Workbook class is an xlsx workbook that manages worksheets, charts, +

+The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles. The following parts of the Office Open XML spreadsheet -specification are not implimented in this version.

- -
bookViews
-calcPr
-customWorkbookViews
-definedNames
-externalReferences
-extLst
-fileRecoveryPr
-fileSharing
-fileVersion
-functionGroups
-oleSize
-pivotCaches
-smartTagPr
-smartTagTypes
-webPublishing
-webPublishObjects
-workbookProtection
-workbookPr*
-
-*workbookPr is only supported to the extend of date1904
+specification are not implimented in this version. +

+
+  bookViews
+  calcPr
+  customWorkbookViews
+  definedNames
+  externalReferences
+  extLst
+  fileRecoveryPr
+  fileSharing
+  fileVersion
+  functionGroups
+  oleSize
+  pivotCaches
+  smartTagPr
+  smartTagTypes
+  webPublishing
+  webPublishObjects
+  workbookProtection
+  workbookPr*
+
+  *workbookPr is only supported to the extend of date1904
+
@@ -134,9 +136,10 @@ workbookPr*
@@date1904 =
- -

Indicates if the epoc date for serialization should be 1904. If false, 1900 -is used.

+

+Indicates if the epoc date for serialization should be 1904. If false, 1900 +is used. +

@@ -146,7 +149,8 @@ is used.

-
false
+
false
+
@@ -174,8 +178,9 @@ is used.

-
-

A colllection of charts associated with this workbook.

+

+A colllection of charts associated with this workbook. +

@@ -200,8 +205,9 @@ is used.

-
-

A colllection of drawings associated with this workbook.

+

+A colllection of drawings associated with this workbook. +

@@ -226,8 +232,9 @@ is used.

-
-

A colllection of images associated with this workbook.

+

+A colllection of images associated with this workbook. +

@@ -252,8 +259,9 @@ is used.

-
-

The styles associated with this workbook.

+

+The styles associated with this workbook. +

@@ -278,8 +286,9 @@ is used.

-
-

A collection of worksheets associated with this workbook.

+

+A collection of worksheets associated with this workbook. +

@@ -314,8 +323,9 @@ is used.

-
-

retrieves the date1904 attribute.

+

+retrieves the date1904 attribute. +

@@ -337,8 +347,9 @@ is used.

-
-

Sets the date1904 attribute to the provided boolean.

+

+Sets the date1904 attribute to the provided boolean. +

@@ -369,8 +380,9 @@ is used.

-
-

Adds a worksheet to this workbook.

+

+Adds a worksheet to this workbook. +

@@ -392,8 +404,9 @@ is used.

-
-

Instance level access to the class variable 1904.

+

+Instance level access to the class variable 1904. +

@@ -415,8 +428,9 @@ is used.

-
-

see @date1904.

+

+see @date1904. +

@@ -440,8 +454,9 @@ is used.

-
-

Creates a new Workbook.

+

+Creates a new Workbook. +

@@ -463,8 +478,9 @@ is used.

-
-

The workbook relationships.

+

+The workbook relationships. +

@@ -486,8 +502,9 @@ is used.

-
-

Serializes the workbook document.

+

+Serializes the workbook document. +

@@ -508,8 +525,9 @@ is used.

- -

Creates a new Workbook

+

+Creates a new Workbook +

@@ -530,8 +548,9 @@ is used.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -582,8 +601,9 @@ is used.

— -
-

the object that the method was called on

+

+the object that the method was called on +

@@ -609,15 +629,16 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 75
 
-def initialize(options={})
-  @styles = Styles.new
-  @worksheets = SimpleTypedList.new Worksheet
-  @drawings = SimpleTypedList.new Drawing
-  @charts = SimpleTypedList.new Chart
-  @images = SimpleTypedList.new Pic
-  self.date1904= options[:date1904] unless options[:date1904].nil?
-  yield self if block_given?      
-end
+def initialize(options={}) + @styles = Styles.new + @worksheets = SimpleTypedList.new Worksheet + @drawings = SimpleTypedList.new Drawing + @charts = SimpleTypedList.new Chart + @images = SimpleTypedList.new Pic + self.date1904= options[:date1904] unless options[:date1904].nil? + yield self if block_given? +end + @@ -643,13 +664,15 @@ is used.

Note: -
-

The recommended way to manage charts is Worksheet#add_chart

+

+The recommended way to manage charts is Worksheet#add_chart +

- -

A colllection of charts associated with this workbook

+

+A colllection of charts associated with this workbook +

@@ -692,9 +715,10 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 45
 
-def charts
-  @charts
-end
+def charts + @charts +end + @@ -715,13 +739,15 @@ is used.

Note: -
-

The recommended way to manage drawings is Worksheet#add_chart

+

+The recommended way to manage drawings is Worksheet#add_chart +

- -

A colllection of drawings associated with this workbook

+

+A colllection of drawings associated with this workbook +

@@ -764,9 +790,10 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 59
 
-def drawings
-  @drawings
-end
+def drawings + @drawings +end + @@ -787,13 +814,15 @@ is used.

Note: -
-

The recommended way to manage images is Worksheet#add_image

+

+The recommended way to manage images is Worksheet#add_image +

- -

A colllection of images associated with this workbook

+

+A colllection of images associated with this workbook +

@@ -836,9 +865,10 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 52
 
-def images
-  @images
-end
+def images + @images +end + @@ -859,13 +889,15 @@ is used.

Note: -
-

The recommended way to manage styles is Styles#add_style

+

+The recommended way to manage styles is Styles#add_style +

- -

The styles associated with this workbook

+

+The styles associated with this workbook +

@@ -908,9 +940,10 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 66
 
-def styles
-  @styles
-end
+def styles + @styles +end + @@ -931,13 +964,15 @@ is used.

Note: -
-

The recommended way to manage worksheets is add_worksheet

+

+The recommended way to manage worksheets is add_worksheet +

- -

A collection of worksheets associated with this workbook.

+

+A collection of worksheets associated with this workbook. +

@@ -980,9 +1015,10 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 38
 
-def worksheets
-  @worksheets
-end
+def worksheets + @worksheets +end + @@ -1004,8 +1040,9 @@ is used.

- -

retrieves the date1904 attribute

+

+retrieves the date1904 attribute +

@@ -1037,7 +1074,8 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 98
 
-def self.date1904() @@date1904; end
+def self.date1904() @@date1904; end + @@ -1052,8 +1090,9 @@ is used.

- -

Sets the date1904 attribute to the provided boolean

+

+Sets the date1904 attribute to the provided boolean +

@@ -1085,7 +1124,8 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 94
 
-def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
+def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end + @@ -1106,8 +1146,9 @@ is used.

- -

Adds a worksheet to this workbook

+

+Adds a worksheet to this workbook +

@@ -1128,8 +1169,9 @@ is used.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -1148,8 +1190,9 @@ is used.

- —
-

The name of the worksheet.

+ —

+The name of the worksheet. +

@@ -1205,11 +1248,12 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 104
 
-def add_worksheet(options={})
-  worksheet = Worksheet.new(self, options)
-  yield worksheet if block_given?
-  worksheet
-end
+def add_worksheet(options={}) + worksheet = Worksheet.new(self, options) + yield worksheet if block_given? + worksheet +end + @@ -1224,8 +1268,9 @@ is used.

- -

Instance level access to the class variable 1904

+

+Instance level access to the class variable 1904 +

@@ -1257,7 +1302,8 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 87
 
-def date1904() @@date1904; end
+def date1904() @@date1904; end + @@ -1272,8 +1318,9 @@ is used.

- -

see @date1904

+

+see @date1904 +

@@ -1292,7 +1339,8 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 90
 
-def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
+def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end + @@ -1307,8 +1355,9 @@ is used.

- -

The workbook relationships. This is managed automatically by the workbook

+

+The workbook relationships. This is managed automatically by the workbook +

@@ -1347,14 +1396,15 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 112
 
-def relationships
-  r = Relationships.new
-  @worksheets.each do |sheet|
-    r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
-  end 
-  r << Relationship.new(STYLES_R,  STYLES_PN)
-  r
-end
+def relationships + r = Relationships.new + @worksheets.each do |sheet| + r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1)) + end + r << Relationship.new(STYLES_R, STYLES_PN) + r +end + @@ -1369,8 +1419,9 @@ is used.

- -

Serializes the workbook document

+

+Serializes the workbook document +

@@ -1415,20 +1466,21 @@ is used.

# File 'lib/axlsx/workbook/workbook.rb', line 123
 
-def to_xml()
-  add_worksheet unless worksheets.size > 0
-  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
-    xml.workbook(:xmlns => XML_NS, :xmlns:r' => XML_NS_R) {
-      xml.workbookPr(:date1904=>@@date1904)
-      xml.sheets {
-        @worksheets.each_with_index do |sheet, index|              
-          xml.sheet(:name=>sheet.name, :sheetId=>index+1, :r:id"=>sheet.rId)
-        end
-      }
-    }
-  end      
-  builder.to_xml(:indent=>0)
-end
+def to_xml() + add_worksheet unless worksheets.size > 0 + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.workbook(:xmlns => XML_NS, :'xmlns:r' => XML_NS_R) { + xml.workbookPr(:date1904=>@@date1904) + xml.sheets { + @worksheets.each_with_index do |sheet, index| + xml.sheet(:name=>sheet.name, :sheetId=>index+1, :"r:id"=>sheet.rId) + end + } + } + end + builder.to_xml(:indent=>0) +end + @@ -1439,9 +1491,9 @@ is used.

-- cgit v1.2.3