使用 axlsx 生成 xls 文件 [英] generating xls file using axlsx

查看:26
本文介绍了使用 axlsx 生成 xls 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 'axlsx' gem 生成 XLS 文件?我已经在使用这个 gem 来生成 xlsx 文件,并且不想将它全部移到不同的 gem 中,尤其是因为 axlsx 更容易使用.

is there a way to generate XLS file using 'axlsx' gem? I'm already using this gem to generate xlsx files, and don't want to move it all to a different gem, especially since axlsx is much easier to work with.

推荐答案

Axlsx 只生成 xlsx 文件(它读取它们.)你必须使用电子表格roo其他内容 直接创建它们.

Axlsx only generates xlsx files (it does not read them.) You'll have to use spreadsheet or roo or something else to directly create them.

我依靠可下载的 Microsoft 转换器从 xlsx 更改为 xls.我只生成一个文件,只要xlsx文件不是太复杂就没有错误.当然,这取决于您的需求.

I rely on the downloadable Microsoft converter to change from xlsx to xls. I only generate one file, and as long as the xlsx file is not too complicated there are no errors. It depends on your needs, of course.

如果您使用 Rails 生成 xlsx,请考虑使用 axlsx_rails.我写了它,它可以让你把所有的 Axlsx 代码放到视图模板中.

If you are generating xlsx with Rails, consider using axlsx_rails. I wrote it, and it lets you put all Axlsx code into view templates.

这篇关于使用 axlsx 生成 xls 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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