Excel sheet generation

Hi,

Does anyone know of a package that will help with generation of spreadsheets? (xls files, not csv)

Thanks, Fredrik

Fredrick, I understand there are 2 routes you can take.

1. write to an open format - this likely depends on the version of Office you want to support. 2. Write a native office document using the win32 gem win32ole.

I used the second option to generate word documents.

Do a google search for win32ole and ruby - you'll find a few examples that should get you started.

Cheers, Jodi General Partner The nNovation Group inc. www.nnovation.ca/blog

Fredrick, I understand there are 2 routes you can take.

  1. write to an open format - this likely depends on the version of

Office you want to support. 2. Write a native office document using the win32 gem win32ole.

I used the second option to generate word documents.

Do a google search for win32ole and ruby - you’ll find a few examples

that should get you started.

The Ruby-POI bindings are another option. I’ve never used these myself, however, it seems like a great cross-platform solution.

http://jakarta.apache.org/poi/poi-ruby.html

Thanks guys, that was a bunch of options, some of which I had no idea you could do. That definately solves my problem. :slight_smile:

-Fredrik

I had some time to do some testing and the spreadsheet writer was very familiar from php :slight_smile: and worked great (current implementation).

I did try out the win32ole, but I could not get it to work. Got some file missing error. After browsing around it seemed like you have to have office installed, since it was talking about people installing it with wine, etc under linux. Is this the case? I did try it under windows.

The POI extensions seemed ok too, but I could not see what they offer beyond the excel writer gem for my needs (for now download data, modify and upload it back)

I am looking for something to read excel files too, and from what I saw, it's planned for in the POI extensions, but don't think it is implemented yet.

Please let me know if you get a chance about the POI and win32ole assumptions I made if they are correct or not.

Thanks, Fredrik

I know this is a little late and it's not a package, but this might help someone searching down the road: Excel 2003 supports XML formats: http://www.microsoft.com/office/xml/default.mspx

There's even a blog:

Gosh, I'm gonna have to work overtime now to check all these things out.

I think Chris' suggestion about the parse excel would be a nice complement to the excel writer I'm currently using. This is nothing overly complicated I'm trying to do.

I have written some java code, but that was a long time ago. Not familiar with much of it.

Thanks again guys. Hopefully all your answers will help someone else too.

Fredrik

This is the route I would go for a next-gen version of the spreadsheet package if I had to do over again. We've got XML generating libraries in pure Ruby (Jim Weirich has one out there, can't think of the name atm), or a wrapper around a C lib would work. From there it's just a matter of working out the interface, which you could probably keep very similar (if not identical) to the current implementation.

This would solve several problems with the current implementation:

* Formula support * Solves 7mb limit (afaik) * Human readable * Greater compatibility with other clients * MUCH easier to debug and maintain. Looking for bugs in packed binary strings SUCKS.

Feel free to pass this on to Hannes on the RubyForge project page. Or better yet, join the project and start working on the implementation. I still have admin rights on the project as well, so if you're serious about creating an XML based implementation, you can contact me offlist as well: djberg96 at nospam at gmail dot com

http://rubyforge.org/projects/spreadsheet/

Regards,

Dan

This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.