Reputation: 27476
I need some gem/plugin to create an Excel spreadsheet with formulas to use in my Rails application. Any suggestions?
Upvotes: 3
Views: 4573
Reputation: 3307
I've used Roo and it's quite good and easy to do spreadsheet processing (once you get all the gem dependencies installed). However, it doesn't support formulas natively. It won't eval the formula and return the result (this would be difficult I think -- use the excel engine?) but it will give you the text of the formula, for example:
=SUM(.A1,.B1)
It'd be pretty easy to handle this specific case but if you have many different formulas and functions then rolling your own evaluator is going to be difficult. Going and getting A1 and B1 to add them together is very doable with Roo. It's just a question of how complex your formulas are.
Upvotes: 1
Reputation: 83680
I think you should create blank Excel file with formulas and then fill it with Rails. Because you can't create formulas with Ruby.
Upvotes: 0
Reputation: 4737
There's a spreadsheet gem listed on RubyGems but having never used it I can't recommend it.
Upvotes: -1