|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
DescriptionSpreadsheet::Excel - A module for generating Excel compatable files on any platform. Version 0.2.3, based on version .26 of Spreadsheet::WriteExcel. Synopsisrequire "spreadsheet/excel" include Spreadsheet workbook = Excel.new("test.xls") # There are three ways to create a format format = workbook.add_format(:color=>"blue",:bold=>1,:underline=>1) format2 = Format.new( :color => "green", :bold => true, :underline => true ) workbook.add_format(format2) format3 = Format.new{ |f| f.color = "red" f.bold = true f.underline = true } workbook.add_format(format3) worksheet1 = workbook.add_worksheet worksheet2 = workbook.add_worksheet("Numbers") worksheet3 = workbook.add_worksheet("Text") worksheet1.write(0,0,"Hello",format) worksheet1.write(1,1,["Matz","Larry","Guido"]) worksheet2.write(1,3,8876,format2) worksheet2.write_column(4,4,[1,2,3]) worksheet3.write(2,2,"World",format3) worksheet3.write(3,3,[[1,2,3],[4,5,6],[7,8,9]]) workbook.close ClassesExcel
Workbook
Worksheet
Format
NotesThis is a port of John McNamara's Spreadsheet::WriteExcel module, version .26 There is no support for formulas yet. Design ChangesThe only somewhat major change was to make OLEWriter a subclass of File, rather than store a filehandle as an attribute within the class. This seems to have worked out fine. Other changes consisted mostly of minor code optimizations. Occasionally I was more terse than John was (for better or for worse). QuestionsQuestions about MS Excel should be directed to Microsoft. Questions about the MS Excel format should be directed to Microsoft. Questions about why I use the hex values that I use should be directed to John McNamara (jmcnamara at cpan dot org). Future PlansAdd support for files > 7MB Add formulas. Better install/configuration Add comments - for now you can find all appropriate comments in John's module. ;) ThanksMany thanks go to John McNamara for his tireless dedication to a very useful (and probably very popular) module. I also thank him for taking the time to answer some of the questions I had for him while porting his code. Copyright© 2002-2003, Daniel J. Berger All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Ruby itself. AuthorDaniel J. Berger djberg96 at yahoo dot com |