开发者

Show value of formula with Spreadsheet gem in Rails

开发者 https://www.devze.com 2023-01-28 03:34 出处:网络
I am trying to show an excel spreadsheet inside a RoR application. I started using the Spreadsheet gem, which works wonderfully. However, when I don\'t know how to show a cell which has a formu开发者_

I am trying to show an excel spreadsheet inside a RoR application. I started using the Spreadsheet gem, which works wonderfully. However, when I don't know how to show a cell which has a formu开发者_JS百科la (I want to show the resulting value). There is a Spreadsheet::Formula class which has a value method that seems for that, but I don't know how to instantiate or use this class. Any help will be appreciated.


Silly me. Just use the value method on the cell :-)

sheet = book.worksheet 0
sheet[1,2].value
0

精彩评论

暂无评论...
验证码 换一张
取 消