axlsx 1.0.9 → 1.0.10a
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/Gemfile.lock +24 -0
- data/README.md +86 -1
- data/axlsx.gemspec +6 -10
- data/doc/Axlsx.html +557 -360
- data/doc/Axlsx/App.html +347 -244
- data/doc/Axlsx/Ar.html +200 -0
- data/doc/Axlsx/Ar/ClassMethods.html +192 -0
- data/doc/Axlsx/Ar/InstanceMethods.html +109 -0
- data/doc/Axlsx/Ar/SingletonMethods.html +304 -0
- data/doc/Axlsx/Axis.html +131 -98
- data/doc/Axlsx/Bar3DChart.html +138 -106
- data/doc/Axlsx/BarSeries.html +73 -54
- data/doc/Axlsx/Border.html +114 -87
- data/doc/Axlsx/BorderPr.html +107 -82
- data/doc/Axlsx/CatAxis.html +93 -68
- data/doc/Axlsx/CatAxisData.html +47 -38
- data/doc/Axlsx/Cell.html +642 -148
- data/doc/Axlsx/CellAlignment.html +152 -111
- data/doc/Axlsx/CellProtection.html +63 -45
- data/doc/Axlsx/CellStyle.html +101 -73
- data/doc/Axlsx/Chart.html +238 -179
- data/doc/Axlsx/Color.html +75 -53
- data/doc/Axlsx/ContentType.html +34 -26
- data/doc/Axlsx/Core.html +54 -42
- data/doc/Axlsx/DataTypeValidator.html +39 -30
- data/doc/Axlsx/Default.html +59 -43
- data/doc/Axlsx/Drawing.html +176 -128
- data/doc/Axlsx/Fill.html +46 -33
- data/doc/Axlsx/Font.html +197 -147
- data/doc/Axlsx/GradientFill.html +114 -82
- data/doc/Axlsx/GradientStop.html +47 -33
- data/doc/Axlsx/GraphicFrame.html +78 -60
- data/doc/Axlsx/Line3DChart.html +125 -97
- data/doc/Axlsx/LineSeries.html +60 -44
- data/doc/Axlsx/Marker.html +98 -71
- data/doc/Axlsx/NumFmt.html +99 -80
- data/doc/Axlsx/OneCellAnchor.html +126 -94
- data/doc/Axlsx/Override.html +59 -43
- data/doc/Axlsx/Package.html +269 -134
- data/doc/Axlsx/PatternFill.html +93 -72
- data/doc/Axlsx/Pic.html +202 -152
- data/doc/Axlsx/Pie3DChart.html +39 -30
- data/doc/Axlsx/PieSeries.html +72 -53
- data/doc/Axlsx/RegexValidator.html +19 -14
- data/doc/Axlsx/Relationship.html +60 -43
- data/doc/Axlsx/Relationships.html +34 -26
- data/doc/Axlsx/RestrictionValidator.html +31 -22
- data/doc/Axlsx/Row.html +241 -67
- data/doc/Axlsx/Scaling.html +80 -59
- data/doc/Axlsx/SerAxis.html +71 -51
- data/doc/Axlsx/Series.html +179 -51
- data/doc/Axlsx/SeriesTitle.html +29 -24
- data/doc/Axlsx/Styles.html +354 -285
- data/doc/Axlsx/TableStyle.html +74 -54
- data/doc/Axlsx/TableStyleElement.html +99 -79
- data/doc/Axlsx/TableStyles.html +65 -47
- data/doc/Axlsx/Title.html +66 -51
- data/doc/Axlsx/TwoCellAnchor.html +129 -96
- data/doc/Axlsx/ValAxis.html +52 -38
- data/doc/Axlsx/ValAxisData.html +32 -27
- data/doc/Axlsx/View3D.html +111 -80
- data/doc/Axlsx/Workbook.html +333 -272
- data/doc/Axlsx/Worksheet.html +1018 -266
- data/doc/Axlsx/Xf.html +188 -134
- data/doc/_index.html +44 -8
- data/doc/class_list.html +1 -1
- data/doc/file.LICENSE.html +28 -23
- data/doc/file.README.html +180 -91
- data/doc/index.html +180 -91
- data/doc/method_list.html +541 -421
- data/doc/top-level-namespace.html +2 -2
- data/examples/example.rb +70 -13
- data/lib/axlsx.rb +1 -0
- data/lib/axlsx/ar.rb +72 -0
- data/lib/axlsx/package.rb +8 -1
- data/lib/axlsx/util/simple_typed_list.rb +5 -0
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/workbook.rb +4 -2
- data/lib/axlsx/workbook/worksheet/row.rb +15 -0
- data/lib/axlsx/workbook/worksheet/worksheet.rb +44 -1
- data/test/workbook/worksheet/tc_row.rb +6 -0
- data/test/workbook/worksheet/tc_worksheet.rb +36 -0
- metadata +103 -59
data/doc/_index.html
CHANGED
@@ -90,6 +90,13 @@
|
|
90
90
|
|
91
91
|
</li>
|
92
92
|
|
93
|
+
<li>
|
94
|
+
<span class='object_link'><a href="Axlsx/Ar.html" title="Axlsx::Ar (module)">Ar</a></span>
|
95
|
+
|
96
|
+
<small>(Axlsx)</small>
|
97
|
+
|
98
|
+
</li>
|
99
|
+
|
93
100
|
<li>
|
94
101
|
<span class='object_link'><a href="Axlsx/Axis.html" title="Axlsx::Axis (class)">Axis</a></span>
|
95
102
|
|
@@ -195,6 +202,13 @@
|
|
195
202
|
|
196
203
|
</li>
|
197
204
|
|
205
|
+
<li>
|
206
|
+
<span class='object_link'><a href="Axlsx/Ar/ClassMethods.html" title="Axlsx::Ar::ClassMethods (module)">ClassMethods</a></span>
|
207
|
+
|
208
|
+
<small>(Axlsx::Ar)</small>
|
209
|
+
|
210
|
+
</li>
|
211
|
+
|
198
212
|
<li>
|
199
213
|
<span class='object_link'><a href="Axlsx/Color.html" title="Axlsx::Color (class)">Color</a></span>
|
200
214
|
|
@@ -300,6 +314,24 @@
|
|
300
314
|
</ul>
|
301
315
|
|
302
316
|
|
317
|
+
<ul id="alpha_I" class="alpha">
|
318
|
+
<li class="letter">I</li>
|
319
|
+
<ul>
|
320
|
+
|
321
|
+
<li>
|
322
|
+
<span class='object_link'><a href="Axlsx/Ar/InstanceMethods.html" title="Axlsx::Ar::InstanceMethods (module)">InstanceMethods</a></span>
|
323
|
+
|
324
|
+
<small>(Axlsx::Ar)</small>
|
325
|
+
|
326
|
+
</li>
|
327
|
+
|
328
|
+
</ul>
|
329
|
+
</ul>
|
330
|
+
|
331
|
+
|
332
|
+
</td><td valign='top' width="33%">
|
333
|
+
|
334
|
+
|
303
335
|
<ul id="alpha_L" class="alpha">
|
304
336
|
<li class="letter">L</li>
|
305
337
|
<ul>
|
@@ -322,9 +354,6 @@
|
|
322
354
|
</ul>
|
323
355
|
|
324
356
|
|
325
|
-
</td><td valign='top' width="33%">
|
326
|
-
|
327
|
-
|
328
357
|
<ul id="alpha_M" class="alpha">
|
329
358
|
<li class="letter">M</li>
|
330
359
|
<ul>
|
@@ -495,6 +524,13 @@
|
|
495
524
|
|
496
525
|
</li>
|
497
526
|
|
527
|
+
<li>
|
528
|
+
<span class='object_link'><a href="Axlsx/Ar/SingletonMethods.html" title="Axlsx::Ar::SingletonMethods (module)">SingletonMethods</a></span>
|
529
|
+
|
530
|
+
<small>(Axlsx::Ar)</small>
|
531
|
+
|
532
|
+
</li>
|
533
|
+
|
498
534
|
<li>
|
499
535
|
<span class='object_link'><a href="Axlsx/Styles.html" title="Axlsx::Styles (class)">Styles</a></span>
|
500
536
|
|
@@ -549,6 +585,9 @@
|
|
549
585
|
</ul>
|
550
586
|
|
551
587
|
|
588
|
+
</td><td valign='top' width="33%">
|
589
|
+
|
590
|
+
|
552
591
|
<ul id="alpha_V" class="alpha">
|
553
592
|
<li class="letter">V</li>
|
554
593
|
<ul>
|
@@ -578,9 +617,6 @@
|
|
578
617
|
</ul>
|
579
618
|
|
580
619
|
|
581
|
-
</td><td valign='top' width="33%">
|
582
|
-
|
583
|
-
|
584
620
|
<ul id="alpha_W" class="alpha">
|
585
621
|
<li class="letter">W</li>
|
586
622
|
<ul>
|
@@ -626,9 +662,9 @@
|
|
626
662
|
</div>
|
627
663
|
|
628
664
|
<div id="footer">
|
629
|
-
Generated on
|
665
|
+
Generated on Sun Nov 27 21:54:10 2011 by
|
630
666
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
631
|
-
0.7.3 (ruby-1.
|
667
|
+
0.7.3 (ruby-1.8.7).
|
632
668
|
</div>
|
633
669
|
|
634
670
|
</body>
|
data/doc/class_list.html
CHANGED
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
<ul id="full_list" class="class">
|
41
41
|
<li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
|
42
|
-
<li><a class='toggle'></a> <span class='object_link'><a href="Axlsx.html" title="Axlsx (module)">Axlsx</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Axlsx/App.html" title="Axlsx::App (class)">App</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Axis.html" title="Axlsx::Axis (class)">Axis</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Bar3DChart.html" title="Axlsx::Bar3DChart (class)">Bar3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/BarSeries.html" title="Axlsx::BarSeries (class)">BarSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Border.html" title="Axlsx::Border (class)">Border</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/BorderPr.html" title="Axlsx::BorderPr (class)">BorderPr</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CatAxis.html" title="Axlsx::CatAxis (class)">CatAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CatAxisData.html" title="Axlsx::CatAxisData (class)">CatAxisData</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Cell.html" title="Axlsx::Cell (class)">Cell</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellAlignment.html" title="Axlsx::CellAlignment (class)">CellAlignment</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellProtection.html" title="Axlsx::CellProtection (class)">CellProtection</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellStyle.html" title="Axlsx::CellStyle (class)">CellStyle</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Chart.html" title="Axlsx::Chart (class)">Chart</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Color.html" title="Axlsx::Color (class)">Color</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ContentType.html" title="Axlsx::ContentType (class)">ContentType</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Core.html" title="Axlsx::Core (class)">Core</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/DataTypeValidator.html" title="Axlsx::DataTypeValidator (class)">DataTypeValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Default.html" title="Axlsx::Default (class)">Default</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Drawing.html" title="Axlsx::Drawing (class)">Drawing</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Fill.html" title="Axlsx::Fill (class)">Fill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Font.html" title="Axlsx::Font (class)">Font</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GradientFill.html" title="Axlsx::GradientFill (class)">GradientFill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GradientStop.html" title="Axlsx::GradientStop (class)">GradientStop</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GraphicFrame.html" title="Axlsx::GraphicFrame (class)">GraphicFrame</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Line3DChart.html" title="Axlsx::Line3DChart (class)">Line3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/LineSeries.html" title="Axlsx::LineSeries (class)">LineSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Marker.html" title="Axlsx::Marker (class)">Marker</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/NumFmt.html" title="Axlsx::NumFmt (class)">NumFmt</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/OneCellAnchor.html" title="Axlsx::OneCellAnchor (class)">OneCellAnchor</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Override.html" title="Axlsx::Override (class)">Override</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Package.html" title="Axlsx::Package (class)">Package</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/PatternFill.html" title="Axlsx::PatternFill (class)">PatternFill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Pic.html" title="Axlsx::Pic (class)">Pic</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Pie3DChart.html" title="Axlsx::Pie3DChart (class)">Pie3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/PieSeries.html" title="Axlsx::PieSeries (class)">PieSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/RegexValidator.html" title="Axlsx::RegexValidator (class)">RegexValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Relationship.html" title="Axlsx::Relationship (class)">Relationship</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Relationships.html" title="Axlsx::Relationships (class)">Relationships</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/RestrictionValidator.html" title="Axlsx::RestrictionValidator (class)">RestrictionValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Row.html" title="Axlsx::Row (class)">Row</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Scaling.html" title="Axlsx::Scaling (class)">Scaling</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/SerAxis.html" title="Axlsx::SerAxis (class)">SerAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Series.html" title="Axlsx::Series (class)">Series</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/SeriesTitle.html" title="Axlsx::SeriesTitle (class)">SeriesTitle</a></span> < Title<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Styles.html" title="Axlsx::Styles (class)">Styles</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyle.html" title="Axlsx::TableStyle (class)">TableStyle</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyleElement.html" title="Axlsx::TableStyleElement (class)">TableStyleElement</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyles.html" title="Axlsx::TableStyles (class)">TableStyles</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Title.html" title="Axlsx::Title (class)">Title</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TwoCellAnchor.html" title="Axlsx::TwoCellAnchor (class)">TwoCellAnchor</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ValAxis.html" title="Axlsx::ValAxis (class)">ValAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ValAxisData.html" title="Axlsx::ValAxisData (class)">ValAxisData</a></span> < CatAxisData<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/View3D.html" title="Axlsx::View3D (class)">View3D</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Workbook.html" title="Axlsx::Workbook (class)">Workbook</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Worksheet.html" title="Axlsx::Worksheet (class)">Worksheet</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Xf.html" title="Axlsx::Xf (class)">Xf</a></span> < Object<small class='search_info'>Axlsx</small></li></ul>
|
42
|
+
<li><a class='toggle'></a> <span class='object_link'><a href="Axlsx.html" title="Axlsx (module)">Axlsx</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Axlsx/App.html" title="Axlsx::App (class)">App</a></span> < Object<small class='search_info'>Axlsx</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Axlsx/Ar.html" title="Axlsx::Ar (module)">Ar</a></span><small class='search_info'>Axlsx</small></li><ul><li><span class='object_link'><a href="Axlsx/Ar/ClassMethods.html" title="Axlsx::Ar::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>Axlsx::Ar</small></li><li><span class='object_link'><a href="Axlsx/Ar/InstanceMethods.html" title="Axlsx::Ar::InstanceMethods (module)">InstanceMethods</a></span><small class='search_info'>Axlsx::Ar</small></li><li><span class='object_link'><a href="Axlsx/Ar/SingletonMethods.html" title="Axlsx::Ar::SingletonMethods (module)">SingletonMethods</a></span><small class='search_info'>Axlsx::Ar</small></li></ul><li><span class='object_link'><a href="Axlsx/Axis.html" title="Axlsx::Axis (class)">Axis</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Bar3DChart.html" title="Axlsx::Bar3DChart (class)">Bar3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/BarSeries.html" title="Axlsx::BarSeries (class)">BarSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Border.html" title="Axlsx::Border (class)">Border</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/BorderPr.html" title="Axlsx::BorderPr (class)">BorderPr</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CatAxis.html" title="Axlsx::CatAxis (class)">CatAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CatAxisData.html" title="Axlsx::CatAxisData (class)">CatAxisData</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Cell.html" title="Axlsx::Cell (class)">Cell</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellAlignment.html" title="Axlsx::CellAlignment (class)">CellAlignment</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellProtection.html" title="Axlsx::CellProtection (class)">CellProtection</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/CellStyle.html" title="Axlsx::CellStyle (class)">CellStyle</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Chart.html" title="Axlsx::Chart (class)">Chart</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Color.html" title="Axlsx::Color (class)">Color</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ContentType.html" title="Axlsx::ContentType (class)">ContentType</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Core.html" title="Axlsx::Core (class)">Core</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/DataTypeValidator.html" title="Axlsx::DataTypeValidator (class)">DataTypeValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Default.html" title="Axlsx::Default (class)">Default</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Drawing.html" title="Axlsx::Drawing (class)">Drawing</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Fill.html" title="Axlsx::Fill (class)">Fill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Font.html" title="Axlsx::Font (class)">Font</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GradientFill.html" title="Axlsx::GradientFill (class)">GradientFill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GradientStop.html" title="Axlsx::GradientStop (class)">GradientStop</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/GraphicFrame.html" title="Axlsx::GraphicFrame (class)">GraphicFrame</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Line3DChart.html" title="Axlsx::Line3DChart (class)">Line3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/LineSeries.html" title="Axlsx::LineSeries (class)">LineSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Marker.html" title="Axlsx::Marker (class)">Marker</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/NumFmt.html" title="Axlsx::NumFmt (class)">NumFmt</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/OneCellAnchor.html" title="Axlsx::OneCellAnchor (class)">OneCellAnchor</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Override.html" title="Axlsx::Override (class)">Override</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Package.html" title="Axlsx::Package (class)">Package</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/PatternFill.html" title="Axlsx::PatternFill (class)">PatternFill</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Pic.html" title="Axlsx::Pic (class)">Pic</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Pie3DChart.html" title="Axlsx::Pie3DChart (class)">Pie3DChart</a></span> < Chart<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/PieSeries.html" title="Axlsx::PieSeries (class)">PieSeries</a></span> < Series<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/RegexValidator.html" title="Axlsx::RegexValidator (class)">RegexValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Relationship.html" title="Axlsx::Relationship (class)">Relationship</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Relationships.html" title="Axlsx::Relationships (class)">Relationships</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/RestrictionValidator.html" title="Axlsx::RestrictionValidator (class)">RestrictionValidator</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Row.html" title="Axlsx::Row (class)">Row</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Scaling.html" title="Axlsx::Scaling (class)">Scaling</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/SerAxis.html" title="Axlsx::SerAxis (class)">SerAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Series.html" title="Axlsx::Series (class)">Series</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/SeriesTitle.html" title="Axlsx::SeriesTitle (class)">SeriesTitle</a></span> < Title<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Styles.html" title="Axlsx::Styles (class)">Styles</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyle.html" title="Axlsx::TableStyle (class)">TableStyle</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyleElement.html" title="Axlsx::TableStyleElement (class)">TableStyleElement</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TableStyles.html" title="Axlsx::TableStyles (class)">TableStyles</a></span> < SimpleTypedList<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Title.html" title="Axlsx::Title (class)">Title</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/TwoCellAnchor.html" title="Axlsx::TwoCellAnchor (class)">TwoCellAnchor</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ValAxis.html" title="Axlsx::ValAxis (class)">ValAxis</a></span> < Axis<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/ValAxisData.html" title="Axlsx::ValAxisData (class)">ValAxisData</a></span> < CatAxisData<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/View3D.html" title="Axlsx::View3D (class)">View3D</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Workbook.html" title="Axlsx::Workbook (class)">Workbook</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Worksheet.html" title="Axlsx::Worksheet (class)">Worksheet</a></span> < Object<small class='search_info'>Axlsx</small></li><li><span class='object_link'><a href="Axlsx/Xf.html" title="Axlsx::Xf (class)">Xf</a></span> < Object<small class='search_info'>Axlsx</small></li></ul>
|
43
43
|
|
44
44
|
</ul>
|
45
45
|
</div>
|
data/doc/file.LICENSE.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
7
|
File: LICENSE
|
8
8
|
|
@@ -54,32 +54,37 @@
|
|
54
54
|
|
55
55
|
<iframe id="search_frame"></iframe>
|
56
56
|
|
57
|
-
<div id="content"><div id='filecontents'>
|
58
|
-
|
59
|
-
|
60
|
-
<p>
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
57
|
+
<div id="content"><div id='filecontents'><p>
|
58
|
+
Copyright © 2011 Randy Morgan
|
59
|
+
</p>
|
60
|
+
<p>
|
61
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
62
|
+
copy of this software and associated documentation files (the
|
63
|
+
"Software"), to deal in the Software without restriction,
|
64
|
+
including without limitation the rights to use, copy, modify, merge,
|
65
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
66
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
67
|
+
following conditions:
|
68
|
+
</p>
|
69
|
+
<p>
|
70
|
+
The above copyright notice and this permission notice shall be included in
|
71
|
+
all copies or substantial portions of the Software.
|
72
|
+
</p>
|
73
|
+
<p>
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
75
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
76
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
77
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
78
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
79
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
80
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
81
|
+
</p>
|
77
82
|
</div></div>
|
78
83
|
|
79
84
|
<div id="footer">
|
80
|
-
Generated on
|
85
|
+
Generated on Sun Nov 27 21:54:11 2011 by
|
81
86
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
82
|
-
0.7.3 (ruby-1.
|
87
|
+
0.7.3 (ruby-1.8.7).
|
83
88
|
</div>
|
84
89
|
|
85
90
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
@@ -61,7 +61,7 @@
|
|
61
61
|
<strong>Author</strong>: Randy Morgan <br/>
|
62
62
|
<strong>Copyright</strong>: 2011 <br/>
|
63
63
|
<strong>License</strong>: MIT License <br/>
|
64
|
-
<strong>Latest Version</strong>: 1.0.
|
64
|
+
<strong>Latest Version</strong>: 1.0.10.a <br/>
|
65
65
|
<strong>Ruby Version</strong>: 1.8.7 - 1.9.3 <br/>
|
66
66
|
<strong>Release Date</strong>: November 26th 2011</p>
|
67
67
|
|
@@ -90,145 +90,225 @@ With Axlsx you can create worksheets with charts, images, automated column width
|
|
90
90
|
|
91
91
|
<p>**7. Add jpg, gif and png images to worksheets</p>
|
92
92
|
|
93
|
+
<p>**8. Build in mixin with Active record. simply add acts_as_xlsx to you models and they will support to_xlsx</p>
|
94
|
+
|
93
95
|
<h2>Installing</h2>
|
94
96
|
|
95
97
|
<p>To install Axlsx, use the following command:</p>
|
96
98
|
|
97
|
-
<pre class="code">$ gem install axlsx
|
99
|
+
<pre class="code">$ <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='axlsx identifier id'>axlsx</span>
|
98
100
|
</pre>
|
99
101
|
|
100
102
|
<h2>Usage</h2>
|
101
103
|
|
102
104
|
<h3>Examples</h3>
|
103
105
|
|
104
|
-
<pre class="code"> <span class='id
|
105
|
-
<span class='id
|
106
|
+
<pre class="code"> <span class='require identifier id'>require</span> <span class='string val'>'rubygems'</span>
|
107
|
+
<span class='require identifier id'>require</span> <span class='string val'>'axlsx'</span>
|
106
108
|
</pre>
|
107
109
|
|
108
110
|
<p>A Simple Workbook</p>
|
109
111
|
|
110
|
-
<pre class="code"> <span class='id
|
111
|
-
<span class='id
|
112
|
-
<span class='id
|
113
|
-
<span class='id
|
114
|
-
<span class='kw'>end</span>
|
115
|
-
<span class='id
|
112
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
113
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
114
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span>
|
115
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span>
|
116
|
+
<span class='end end kw'>end</span>
|
117
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example1.xlsx"</span><span class='rparen token'>)</span>
|
116
118
|
</pre>
|
117
119
|
|
118
120
|
<p>Generating A Bar Chart</p>
|
119
121
|
|
120
|
-
<pre class="code"> <span class='id
|
121
|
-
<span class='id
|
122
|
-
<span class='id
|
123
|
-
<span class='id
|
124
|
-
<span class='id
|
125
|
-
<span class='id
|
126
|
-
<span class='kw'>end</span>
|
127
|
-
<span class='kw'>end</span>
|
128
|
-
<span class='id
|
122
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
123
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
124
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span>
|
125
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span>
|
126
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Bar3DChart constant id'>Bar3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 2: Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span>
|
127
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span>
|
128
|
+
<span class='end end kw'>end</span>
|
129
|
+
<span class='end end kw'>end</span>
|
130
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example2.xlsx"</span><span class='rparen token'>)</span>
|
129
131
|
</pre>
|
130
132
|
|
131
133
|
<p>Generating A Pie Chart</p>
|
132
134
|
|
133
|
-
<pre class="code"> <span class='id
|
134
|
-
<span class='id
|
135
|
-
<span class='id
|
136
|
-
<span class='id
|
137
|
-
<span class='id
|
138
|
-
<span class='id
|
139
|
-
<span class='kw'>end</span>
|
140
|
-
<span class='kw'>end</span>
|
141
|
-
<span class='id
|
135
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
136
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
137
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span>
|
138
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span>
|
139
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Pie3DChart constant id'>Pie3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 3: Pie Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span>
|
140
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span>
|
141
|
+
<span class='end end kw'>end</span>
|
142
|
+
<span class='end end kw'>end</span>
|
143
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example3.xlsx"</span><span class='rparen token'>)</span>
|
142
144
|
</pre>
|
143
145
|
|
144
146
|
<p>Using Custom Styles</p>
|
145
147
|
|
146
|
-
<pre class="code"> <span class='id
|
147
|
-
<span class='id
|
148
|
-
<span class='id
|
149
|
-
<span class='id
|
150
|
-
<span class='id
|
151
|
-
<span class='id
|
152
|
-
<span class='id
|
153
|
-
<span class='kw'>end</span>
|
154
|
-
<span class='id
|
148
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
149
|
+
<span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span>
|
150
|
+
<span class='black_cell identifier id'>black_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span>
|
151
|
+
<span class='blue_cell identifier id'>blue_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF0000FF"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span>
|
152
|
+
<span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
153
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Text Autowidth"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='black_cell identifier id'>black_cell</span><span class='comma token'>,</span> <span class='blue_cell identifier id'>blue_cell</span><span class='comma token'>,</span> <span class='black_cell identifier id'>black_cell</span><span class='rbrack token'>]</span>
|
154
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
|
155
|
+
<span class='end end kw'>end</span>
|
156
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example4.xlsx"</span><span class='rparen token'>)</span>
|
155
157
|
</pre>
|
156
158
|
|
157
159
|
<p>Using Custom Formatting and date1904</p>
|
158
160
|
|
159
|
-
<pre class="code"> <span class='id
|
160
|
-
<span class='id
|
161
|
-
<span class='id
|
162
|
-
<span class='id
|
163
|
-
<span class='id
|
164
|
-
<span class='id
|
165
|
-
|
166
|
-
<span class='id
|
167
|
-
<span class='id
|
168
|
-
<span class='kw'>end</span>
|
169
|
-
<span class='id
|
161
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
162
|
+
<span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span>
|
163
|
+
<span class='date identifier id'>date</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"yyyy-mm-dd"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
|
164
|
+
<span class='padded identifier id'>padded</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"00#"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
|
165
|
+
<span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"0%"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
|
166
|
+
<span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='date1904 identifier id'>date1904</span> <span class='assign token'>=</span> <span class='true true kw'>true</span> <span class='comment val'># required for generation on mac</span>
|
167
|
+
<span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
168
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Custom Formatted Date"</span><span class='comma token'>,</span> <span class='string val'>"Percent Formatted Float"</span><span class='comma token'>,</span> <span class='string val'>"Padded Numbers"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
|
169
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>32</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='date identifier id'>date</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='padded identifier id'>padded</span><span class='rbrack token'>]</span>
|
170
|
+
<span class='end end kw'>end</span>
|
171
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example5.xlsx"</span><span class='rparen token'>)</span>
|
170
172
|
</pre>
|
171
173
|
|
172
174
|
<p>Validation</p>
|
173
175
|
|
174
|
-
<pre class="code"> <span class='id
|
175
|
-
<span class='id
|
176
|
-
<span class='id
|
177
|
-
<span class='id
|
178
|
-
<span class='kw'>end</span>
|
176
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
177
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
178
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span>
|
179
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span>
|
180
|
+
<span class='end end kw'>end</span>
|
179
181
|
|
180
|
-
<span class='id
|
181
|
-
<span class='id
|
182
|
-
<span class='kw'>end</span>
|
182
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='error identifier id'>error</span><span class='bitor op'>|</span>
|
183
|
+
<span class='puts identifier id'>puts</span> <span class='error identifier id'>error</span><span class='dot token'>.</span><span class='inspect identifier id'>inspect</span>
|
184
|
+
<span class='end end kw'>end</span>
|
183
185
|
</pre>
|
184
186
|
|
185
187
|
<p>Generating A Line Chart</p>
|
186
188
|
|
187
|
-
<pre class="code"> <span class='id
|
188
|
-
<span class='id
|
189
|
-
<span class='id
|
190
|
-
<span class='id
|
191
|
-
<span class='id
|
192
|
-
<span class='id
|
193
|
-
<span class='id
|
194
|
-
<span class='id
|
195
|
-
<span class='id
|
196
|
-
<span class='kw'>end</span>
|
197
|
-
|
198
|
-
<span class='kw'>end</span>
|
199
|
-
<span class='id
|
189
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
190
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
191
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>7</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span>
|
192
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>14</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span>
|
193
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Line3DChart constant id'>Line3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 6: Line Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span>
|
194
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='integer val'>2</span>
|
195
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='end_at identifier id'>end_at</span> <span class='integer val'>10</span><span class='comma token'>,</span> <span class='integer val'>15</span>
|
196
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
|
197
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
|
198
|
+
<span class='end end kw'>end</span>
|
199
|
+
|
200
|
+
<span class='end end kw'>end</span>
|
201
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example6.xlsx"</span><span class='rparen token'>)</span>
|
200
202
|
</pre>
|
201
203
|
|
202
204
|
<p>Adding an Image</p>
|
203
205
|
|
204
|
-
<pre class="code"> <span class='id
|
205
|
-
<span class='id
|
206
|
-
<span class='id
|
207
|
-
<span class='id
|
208
|
-
<span class='id
|
209
|
-
<span class='id
|
210
|
-
<span class='kw'>end</span>
|
211
|
-
<span class='kw'>end</span>
|
212
|
-
<span class='id
|
206
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
207
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
208
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_image identifier id'>add_image</span><span class='lparen token'>(</span><span class='symbol val'>:image_src</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='__FILE__ __file__ kw'>__FILE__</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='string val'>"/image1.png"</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='image identifier id'>image</span><span class='bitor op'>|</span>
|
209
|
+
<span class='image identifier id'>image</span><span class='dot token'>.</span><span class='width identifier id'>width</span><span class='assign token'>=</span><span class='integer val'>720</span>
|
210
|
+
<span class='image identifier id'>image</span><span class='dot token'>.</span><span class='height identifier id'>height</span><span class='assign token'>=</span><span class='integer val'>666</span>
|
211
|
+
<span class='image identifier id'>image</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>2</span>
|
212
|
+
<span class='end end kw'>end</span>
|
213
|
+
<span class='end end kw'>end</span>
|
214
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example7.xlsx"</span><span class='rparen token'>)</span>
|
213
215
|
</pre>
|
214
216
|
|
215
217
|
<p>Asian Language Support</p>
|
216
218
|
|
217
|
-
<pre class="code"> <span class='id
|
218
|
-
<span class='id
|
219
|
-
<span class='id
|
220
|
-
<span class='id
|
221
|
-
<span class='id
|
222
|
-
<span class='kw'>end</span>
|
223
|
-
<span class='id
|
219
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
220
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
221
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"日本語"</span><span class='rbrack token'>]</span>
|
222
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"华语/華語"</span><span class='rbrack token'>]</span>
|
223
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"한국어/조선말"</span><span class='rbrack token'>]</span>
|
224
|
+
<span class='end end kw'>end</span>
|
225
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example8.xlsx"</span><span class='rparen token'>)</span>
|
226
|
+
</pre>
|
227
|
+
|
228
|
+
<p>Styling Columns</p>
|
229
|
+
|
230
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
231
|
+
<span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span>
|
232
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
233
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span>
|
234
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
235
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
236
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
237
|
+
<span class='end end kw'>end</span>
|
238
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span>
|
239
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example10.xlsx"</span><span class='rparen token'>)</span>
|
240
|
+
</pre>
|
241
|
+
|
242
|
+
<p>Styling Rows</p>
|
243
|
+
|
244
|
+
<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
245
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span>
|
246
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span>
|
247
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
248
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
249
|
+
<span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span>
|
250
|
+
<span class='end end kw'>end</span>
|
251
|
+
<span class='head identifier id'>head</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color=</span><span class='gt op'>></span><span class='string val'>"FFFFFFFF"</span>
|
252
|
+
<span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span>
|
253
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span>
|
254
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='row_style identifier id'>row_style</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='head identifier id'>head</span>
|
255
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example11.xlsx"</span><span class='rparen token'>)</span>
|
256
|
+
</pre>
|
257
|
+
|
258
|
+
<p>Rails 3</p>
|
259
|
+
|
260
|
+
<pre class="code"> <span class='comment val'>#ImageMagick port needs to be confirgured --disable-openmp when using with rails3</span>
|
261
|
+
<span class='comment val'>#http://stackoverflow.com/questions/2838307/why-is-this-rmagick-call-generating-a-segmentation-fault</span>
|
262
|
+
|
263
|
+
<span class='comment val'>#Add the gem to your Gemfile and bundle install</span>
|
264
|
+
<span class='gem identifier id'>gem</span> <span class='string val'>'axlsx'</span>
|
265
|
+
|
266
|
+
<span class='comment val'># A Model that has id, name, title, content, vote, popularity, created_at and updated_at attributes </span>
|
267
|
+
<span class='class class kw'>class</span> <span class='Post constant id'>Post</span> <span class='lt op'><</span> <span class='ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span>
|
268
|
+
|
269
|
+
<span class='comment val'># support for :include, :exclude, :only like ruport has not been implemented yet</span>
|
270
|
+
<span class='acts_as_axlsx identifier id'>acts_as_axlsx</span>
|
271
|
+
|
272
|
+
<span class='def def kw'>def</span> <span class='report identifier id'>report</span>
|
273
|
+
<span class='comment val'># First generate your package from the model</span>
|
274
|
+
<span class='comment val'># scopes, conditions etc are allowed but must be before the to_xlsx call.</span>
|
275
|
+
<span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Post constant id'>Post</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span>
|
276
|
+
|
277
|
+
<span class='comment val'># Add in some basic styles and formats</span>
|
278
|
+
<span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='date identifier id'>date</span><span class='comma token'>,</span> <span class='header identifier id'>header</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='comma token'>,</span> <span class='nil nil kw'>nil</span><span class='comma token'>,</span> <span class='nil nil kw'>nil</span>
|
279
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span>
|
280
|
+
<span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt=</span><span class='gt op'>></span><span class='integer val'>9</span>
|
281
|
+
<span class='date identifier id'>date</span> <span class='assign token'>=</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'yyyy/mm/dd'</span>
|
282
|
+
<span class='header identifier id'>header</span> <span class='assign token'>=</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span><span class='symbol val'>:horizontal=</span><span class='gt op'>></span><span class='symbol val'>:center</span><span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span>
|
283
|
+
<span class='end end kw'>end</span>
|
284
|
+
|
285
|
+
<span class='ws identifier id'>ws</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
|
286
|
+
|
287
|
+
<span class='comment val'># Update the row and columns style so they propery format data.</span>
|
288
|
+
<span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='row_style identifier id'>row_style</span><span class='lparen token'>(</span><span class='integer val'>0</span><span class='comma token'>,</span> <span class='header identifier id'>header</span><span class='rparen token'>)</span>
|
289
|
+
<span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span><span class='lparen token'>(</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span><span class='rparen token'>)</span>
|
290
|
+
<span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span><span class='lparen token'>(</span><span class='lparen token'>(</span><span class='float val'>6</span><span class='dot2 op'>..</span><span class='integer val'>7</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='date identifier id'>date</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span><span class='rparen token'>)</span>
|
291
|
+
|
292
|
+
<span class='comment val'># Add a chart for good measure</span>
|
293
|
+
<span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Bar3DChart constant id'>Bar3DChart</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span>
|
294
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='title identifier id'>title</span><span class='assign token'>=</span><span class='string val'>'Post Votes'</span>
|
295
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='size identifier id'>size</span>
|
296
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='end_at identifier id'>end_at</span> <span class='integer val'>4</span><span class='comma token'>,</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='size identifier id'>size</span><span class='plus op'>+</span><span class='integer val'>20</span>
|
297
|
+
<span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='cols identifier id'>cols</span><span class='lbrack token'>[</span><span class='integer val'>4</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span><span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='cols identifier id'>cols</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
|
298
|
+
<span class='end end kw'>end</span>
|
299
|
+
|
300
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'posts.xlsx'</span><span class='rparen token'>)</span>
|
301
|
+
<span class='send_file identifier id'>send_file</span> <span class='string val'>'posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span><span class='comma token'>,</span> <span class='symbol val'>:x_sendfile=</span><span class='gt op'>></span><span class='true true kw'>true</span>
|
302
|
+
<span class='end end kw'>end</span>
|
303
|
+
<span class='end end kw'>end</span>
|
224
304
|
</pre>
|
225
305
|
|
226
306
|
<h3>Documentation</h3>
|
227
307
|
|
228
308
|
<p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p>
|
229
309
|
|
230
|
-
<pre class="code"> <span class='id
|
231
|
-
<span class='id
|
310
|
+
<pre class="code"> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='yard identifier id'>yard</span>
|
311
|
+
<span class='yard identifier id'>yard</span> <span class='server identifier id'>server</span> <span class='minus op'>-</span><span class='g identifier id'>g</span>
|
232
312
|
</pre>
|
233
313
|
|
234
314
|
<h3>Specs</h3>
|
@@ -238,7 +318,16 @@ With Axlsx you can create worksheets with charts, images, automated column width
|
|
238
318
|
<h2>Changelog</h2>
|
239
319
|
|
240
320
|
<ul>
|
241
|
-
<li><strong>October.
|
321
|
+
<li><p><strong>October.27.11</strong>: 1.0.10.a release</p>
|
322
|
+
|
323
|
+
<ul>
|
324
|
+
<li>Updating gemspec to loosen up some of the gem requirements in the hope of maintaining compatibility with rails 2</li>
|
325
|
+
<li>Added acts_as_xlsx mixin for rails3 See Examples</li>
|
326
|
+
<li>Added row.style assignation for updating the cell style for an entire row</li>
|
327
|
+
<li>Added col_style method to worksheet upate a the style for a column of cells</li>
|
328
|
+
</ul>
|
329
|
+
</li>
|
330
|
+
<li><p><strong>October.26.11</strong>: 1.0.9 release</p>
|
242
331
|
|
243
332
|
<ul>
|
244
333
|
<li>Updated to support ruby 1.9.3</li>
|
@@ -257,9 +346,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title
|
|
257
346
|
</div></div>
|
258
347
|
|
259
348
|
<div id="footer">
|
260
|
-
Generated on
|
349
|
+
Generated on Sun Nov 27 21:54:11 2011 by
|
261
350
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
262
|
-
0.7.3 (ruby-1.
|
351
|
+
0.7.3 (ruby-1.8.7).
|
263
352
|
</div>
|
264
353
|
|
265
354
|
</body>
|