lib/xlsx/formatter.rb in simonmenke-xlsx-0.0.1 vs lib/xlsx/formatter.rb in simonmenke-xlsx-0.0.2
- old
+ new
@@ -74,11 +74,11 @@
end
xml.sheetData do
rows.each do |row|
xml.row({ 'r' => row.first.to_s, 'ht' => '12.1' }) do
row.last.each do |cell|
- xml.c({ 'r' => "#{letter_column_name(cell.column+1)}#{row.first + 1}", 't' => cell.type }) do
+ xml.c({ 'r' => "#{letter_column_name(cell.column+1)}#{row.first + 1}", 't' => cell.type, 's' => cell.style }) do
xml.v(cell.value.to_s)
end
end
end
end
@@ -191,56 +191,24 @@
xml.patternFill({ 'patternType' => 'none' })
end
xml.fill do
xml.patternFill({ 'patternType' => 'gray125' })
end
- xml.fill do
- xml.patternFill({ 'patternType' => 'none' })
- end
- xml << "$-$"
- xml.fill do
- xml.patternFill({ 'patternType' => 'none' })
- end
- xml.fill do
- xml.patternFill({ 'patternType' => 'none' })
- end
end
xml.borders do
xml.border do
xml.left
xml.right
xml.top
xml.bottom
xml.diagonal
end
- xml.border do
- xml.left
- xml.right
- xml.top
- xml.bottom
- xml.diagonal
- end
- xml.border do
- xml.left
- xml.right
- xml.top
- xml.bottom
- xml.diagonal
- end
- xml.border do
- xml.left
- xml.right
- xml.top
- xml.bottom
- xml.diagonal
- end
end
- xml.cellStyleXfs({ 'count' => '6' }) do
+ xml.cellStyleXfs({ 'count' => '5' }) do
xml.xf({ 'numFmtId' => '0', 'fontId' => '0', 'fillId' => '0', 'borderId' => '0' })
- xml.xf({ 'numFmtId' => '0', 'fontId' => '0', 'fillId' => '0', 'borderId' => '0' })
xml.xf({ 'numFmtId' => '0', 'fillId' => '0', 'borderId' => '0', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '2' })
xml.xf({ 'numFmtId' => '3', 'fillId' => '0', 'borderId' => '0', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '2' })
xml.xf({ 'numFmtId' => '0', 'fillId' => '0', 'borderId' => '0', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '3', 'applyAlignment' => '1' }) do
xml.alignment({ 'horizontal' => 'center' })
end
@@ -248,10 +216,9 @@
xml.alignment({ 'horizontal' => 'center', 'textRotation' => '90' })
end
end
xml.cellXfs({ 'count' => '1' }) do
- xml.xf({ 'numFmtId' => '0', 'fontId' => '0', 'fillId' => '0', 'borderId' => '0', 'xfId' => '0' })
xml.xf({ 'numFmtId' => '0', 'fontId' => '0', 'fillId' => '0', 'borderId' => '0', 'xfId' => '1' })
xml.xf({ 'numFmtId' => '0', 'fillId' => '0', 'borderId' => '0', 'xfId' => '2', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '2' })
xml.xf({ 'numFmtId' => '3', 'fillId' => '0', 'borderId' => '0', 'xfId' => '3', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '2' })
xml.xf({ 'numFmtId' => '0', 'fillId' => '0', 'borderId' => '0', 'xfId' => '4', 'applyFont' => '1', 'ZMIENNA_contentFontsCount' => '0', 'ZMIENNA_styleFontsCount' => '2', 'fontId' => '3', 'applyAlignment' => '1' }) do
xml.alignment({ 'horizontal' => 'center' })