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/Border.html | 201 ++++++++++++++++++++++++++++---------------------- 1 file changed, 114 insertions(+), 87 deletions(-) (limited to 'doc/Axlsx/Border.html') diff --git a/doc/Axlsx/Border.html b/doc/Axlsx/Border.html index 26e5cfff..18ebcd51 100644 --- a/doc/Axlsx/Border.html +++ b/doc/Axlsx/Border.html @@ -94,8 +94,9 @@

Overview

- -

This class details a border used in Office Open XML spreadsheet styles.

+

+This class details a border used in Office Open XML spreadsheet styles. +

@@ -127,10 +128,11 @@ -
-

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -155,9 +157,10 @@ cell.

-
-

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -182,10 +185,11 @@ include a diagonal line from the bottom left to the top right of the cell.

-
-

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -210,8 +214,9 @@ cells.

-
-

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -248,8 +253,9 @@ cells.

-
-

Creates a new Border object.

+

+Creates a new Border object. +

@@ -271,8 +277,9 @@ cells.

-
-

Serializes the border element.

+

+Serializes the border element. +

@@ -293,8 +300,9 @@ cells.

- -

Creates a new Border object

+

+Creates a new Border object +

@@ -304,18 +312,20 @@ cells.

Examples:

-

-

Making a border

+

+Making a border +

-
p = Package.new
-red_border = Border.new
-[:left, :right, :top, :bottom].each do |item| 
-  red_border.prs << BorderPr.new(:name=>item, :style=>:thin, :color=>Color.new(:rgb=>"FFFF0000"))     #   
-end
-# this sets red_border to be the index for the created border.
-red_border = p.workbook.styles.@borders << red_border
-#used in row creation as follows. This will add a red border to each of the cells in the row.
-p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
+
p = Package.new
+red_border = Border.new
+[:left, :right, :top, :bottom].each do |item| 
+  red_border.prs << BorderPr.new(:name=>item, :style=>:thin, :color=>Color.new(:rgb=>"FFFF0000"))     #   
+end
+# this sets red_border to be the index for the created border.
+red_border = p.workbook.styles.@borders << red_border
+#used in row creation as follows. This will add a red border to each of the cells in the row.
+p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
+

Parameters:

@@ -333,8 +343,9 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border — -
-

a customizable set of options

+

+a customizable set of options +

@@ -394,12 +405,13 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
# File 'lib/axlsx/stylesheet/border.rb', line 31
 
-def initialize(options={})
-  @prs = SimpleTypedList.new BorderPr
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
-  end
-end
+def initialize(options={}) + @prs = SimpleTypedList.new BorderPr + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -422,10 +434,11 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border

- -

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -443,10 +456,11 @@ cell.

— -
-

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -466,9 +480,10 @@ cell.

# File 'lib/axlsx/stylesheet/border.rb', line 9
 
-def diagonalDown
-  @diagonalDown
-end
+def diagonalDown + @diagonalDown +end + @@ -486,9 +501,10 @@ cell.

- -

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -506,9 +522,10 @@ include a diagonal line from the bottom left to the top right of the cell.

— -
-

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -528,9 +545,10 @@ include a diagonal line from the bottom left to the top right of the cell.

# File 'lib/axlsx/stylesheet/border.rb', line 6
 
-def diagonalUp
-  @diagonalUp
-end
+def diagonalUp + @diagonalUp +end + @@ -548,10 +566,11 @@ include a diagonal line from the bottom left to the top right of the cell.

- -

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -569,10 +588,11 @@ cells.

— -
-

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -592,9 +612,10 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 12
 
-def outline
-  @outline
-end
+def outline + @outline +end + @@ -612,8 +633,9 @@ cells.

- -

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -631,8 +653,9 @@ cells.

— -
-

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -652,9 +675,10 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 15
 
-def prs
-  @prs
-end
+def prs + @prs +end + @@ -676,8 +700,9 @@ cells.

- -

Serializes the border element

+

+Serializes the border element +

@@ -696,8 +721,9 @@ cells.

— -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -724,15 +750,16 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 47
 
-def to_xml(xml)
-  xml.border(self.instance_values.select{ |k,v| [:diagonalUp, :diagonalDown, :outline].include? k }) {
-    [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal].each do |k|
-      @prs.select { |pr| pr.name == k }.each do |part| 
-        part.to_xml(xml) 
-      end
-    end
-  }
-end
+def to_xml(xml) + xml.border(self.instance_values.select{ |k,v| [:diagonalUp, :diagonalDown, :outline].include? k }) { + [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal].each do |k| + @prs.select { |pr| pr.name == k }.each do |part| + part.to_xml(xml) + end + end + } +end + @@ -743,9 +770,9 @@ cells.

-- cgit v1.2.3