我正在使用名为 dataExporter
的 primefaces
组件将数据导出到 xls 文件中。我的问题是导出的 Excel 中的列数不能超过 256,因为我收到此错误:
java.lang.IllegalArgumentException: Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV')
我调查了一下,发现 this - 所以看来我的错误来自于以下事实:dataExporter 可能使用 org.apache.poi.hssf.usermodel 而不是较新的 org.apache.poi.xssf.usermodel >。我可以告诉这个 primefaces
组件使用不同的实现吗?或者也许我可以使用不同的 primefaces
组件?有什么想法吗?
最佳答案
我的问题的解决方案确实是@BackSlash 和@Melloware 在他们的评论中所建议的
- 升级我的
primefaces
版本至 6.0 使用
xlsxstream
导出器类型<p:dataExporter type="xlsxstream" target="my-table" fileName="my-file" />
稍后编辑:xlsx
type 可能也是一个不错的选择,请参阅 this question之间的比较 xlsx
和xlsxstream
关于java - 导出包含超过 256 列且带有 primefaces 的 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51727297/