为什么我不能生成大的XLS(> 1000行)?

我search更快的XLS生成,我发现这个Railscast 。

我创build了10000个产品,并在模型中添加了更多的字段。

在XLS模板中,我输出了超过20个字段。

1000个产品被导出,但是当我尝试增加这个数字(为了testing性能)LibreOffice无法打开它。 还尝试将其上传到GoogleDrive并打开 – 也失败。

也许在我的模板有什么错误?

<?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <Worksheet ss:Name="Sheet1"> <Table> <Row> <Cell><Data ss:Type="String">ID</Data></Cell> ...20 headers... </Row> <% @products.each do |product| %> <Row> <Cell><Data ss:Type="Number"><%= product.id %></Data></Cell> ...20 fields ... </Row> <% end %> </Table> </Worksheet> </Workbook>