红宝石电子表格宝石可以包装文字吗? [英] Can the ruby spreadsheet gem wrap text?

查看:165
本文介绍了红宝石电子表格宝石可以包装文字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用ruby电子表格宝石来生成一个电子表格,其中包含文本的单元格? (如果没有,还有其他方法吗?)



谢谢,
- 保罗



PS为了回应两个好的建议,不幸的是不会为我工作,我应该注意:
1)我不能将我的ruby应用程序转换为JRuby在这个时候。
2)我在Linux上开发,而不是Windows开发。

解决方案

请尝试使用Ruby电子表格gem: p>

  fmt = Spreadsheet :: Format.new:text_wrap => true 
sheet.row(y).set_format(x,fmt)



http://rubyforge.org/forum/forum.php?set=custom&forum_id=2920&style=nested&max_rows=50&submit=Change+View


Is there a way to use the ruby spreadsheet gem to produce a spreadsheet with a cell whose text is wrapped? (If not, is there some other way to do it?)

Thanks, --Paul

p.s. In response to two good suggestions that unfortunately won't work for me, I should note: 1) I cannot convert my ruby application to JRuby at this time. 2) I am developing on Linux, not Windows.

解决方案

Please try this for Ruby spreadsheet gem:

 fmt = Spreadsheet::Format.new :text_wrap => true
 sheet.row(y).set_format(x, fmt)

form here:

http://rubyforge.org/forum/forum.php?set=custom&forum_id=2920&style=nested&max_rows=50&submit=Change+View

这篇关于红宝石电子表格宝石可以包装文字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆