####################################################################### # # A simple example of how to use the WriteXLSX gem to # add all shapes (as currently implemented) to an Excel xlsx file. # # The list at the end consists of all the shape types defined as # ST_ShapeType in ECMA-376, Office Open XML File Formats Part 4. # # The grouping by worksheet name is for illustration only. It isn't # part of the ECMA-376 standard. # # reverse(c), May 2012, John McNamara, jmcnamara@cpan.org # converted to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com # require 'write_xlsx' shapes_list = < name, :text => name, :width => 90, :height => 90 ) # Connectors can not have labels, so write the connector name in the cell # to the left. worksheet.write(row, 0, name) if sheet == 'Connector' worksheet.insert_shape(row, 2, shape, 0, 0) row += 5 end workbook.close