diff options
| author | Weston Ganger <[email protected]> | 2019-10-28 16:41:20 -0700 |
|---|---|---|
| committer | Stefan Daschek <[email protected]> | 2019-10-29 01:11:42 +0100 |
| commit | 76975a38e56b3cb3d13ed4e2b59afb0d2aaaef0f (patch) | |
| tree | b777b1ab4ab56d6d81e96b778caf808c21a56f22 /rubima.md | |
| parent | 2224dbc942c15122d2c66f3371a42b502aa2aeab (diff) | |
| download | caxlsx-76975a38e56b3cb3d13ed4e2b59afb0d2aaaef0f.tar.gz caxlsx-76975a38e56b3cb3d13ed4e2b59afb0d2aaaef0f.zip | |
Remove rubima.md
Diffstat (limited to 'rubima.md')
| -rw-r--r-- | rubima.md | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/rubima.md b/rubima.md deleted file mode 100644 index d5199bc4..00000000 --- a/rubima.md +++ /dev/null @@ -1,74 +0,0 @@ -Axlsx – The end of CSV as an excuse for client reporting. - -One of the things that keeps popping up for ruby and ruby on rails application developers is client reporting. -We have tools for creating beautiful screen based reports that make the end user say “WOW”, we can even - -with the help of a great designer - produce a well formatted PDF. But when it comes to data, we are still -using CSV, a technology from the 1960's - -That has changed. There is a new gem, released in November of last year and still under active development -that brings more to ruby and ruby on rails than was ever possible before for client reporting. - -The gem is caxlsx (http://rubygems.org/gems/caxlsx) - -Let's take a look at some of the things that it can do for you. - -1. The Basics -The basics of generating and serializing xlsx data are dead simple. - -1. Create a package -2. Setup your styles -3. add a worksheet to the workbook -3. add your data, charts, images, conditional formatting, data - validations, page setup, print options, and password locking, -comments, cell merges and panes. -4. serialize - -The code below illustrates a trivial example a few of these items - -'''ruby -require 'axlsx' - -package = Axlsx::Package.new -styles = package.workbook.styles - -header = styles.add_style :bg_color => '00', :fg_color => 'FF', :sz => 16, :alignment => { :horizontal => :center } - -quarter_label = styles.add_style :bg_color => 'FFDFDEDF', :alignment => { :indent => 1 }, :sz => 14 - -money = styles.add_style :num_fmt => 5, :zd => 14 - -package.workbook.add_worksheet do |worksheet| - worksheet.add_row ['Revenue by Quarter'], :style => header - worksheet.merge_cells 'A1:I1' - worksheet.add_row - data_row_style = [nil, quarter_label, money] - - worksheet.add_row [nil, 'Q1', 35221124], :style => data_row_style - worksheet.add_row [nil, 'Q2', 56742113], :style => data_row_style - worksheet.add_row [nil, 'Q3', 71165443], :style => data_row_style - worksheet.add_row [nil, 'Q4', 98761111], :style => data_row_style - - worksheet.add_chart(Axlsx::Bar3DChart, :bar_dir => :col) do |chart| - chart.start_at 4, 2 - chart.end_at 9, 15 - chart.title = worksheet['A1'] - chart.add_series :data => worksheet['C3:C6'], :labels => worksheet['B3:B6'] - end -end -package.serialize 'the_better_basics.xlsx' - -If you are using rails, there is a sister gem acts_as_xlsx (http://rubygems.org/gems/axlsx) -That is going to make you smile as well. - -Have a look at these two blog posts for a quick write up of how easy it -is to use. - -http://axlsx.blogspot.jp/2011/12/using-actsasxlsx-to-generate-excel-data.html -http://axlsx.blogspot.jp/2011/12/axlsx-making-excel-reports-with-ruby-on.html - - - - - - - |
