Primefaces DataExporter - XLSX 和 XLSXSTREAM [英] Primefaces DataExporter - XLSX and XLSXSTREAM

查看:26
本文介绍了Primefaces DataExporter - XLSX 和 XLSXSTREAM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎在 PrimeFaces 的最新版本中,为 DataExporter 添加了新类型(参见 ExporterType 来自当前的 primefaces 6.2 文档)

It seems that with the recent versions of PrimeFaces, new types were added for the DataExporter (see ExporterType from the current primefaces 6.2 docs)

我似乎在网络上找不到关于新的 Apache POI XLSX 和 XLSXSTREAM 类型的任何信息.有人可以解释一下两者之间的区别吗?一个比另一个更有效吗?导出数据的大小是否有限制?

I can't seem to find anything on the web regarding the new Apache POI XLSX and XLSXSTREAM types. Can somebody explain the differences between the two of them? Is one more efficient that the other? Are there limitations regarding the size of the exported data?

推荐答案

我可以解释.它们都生成完全相同的 XLSX 文件,这些文件是使用 Apache POI 的 Excel 文件的开放文档格式.我所知道的大小没有限制.

I can explain. They both produce the exact same XLSX files which are the Open Document format of Excel files using Apache POI. There is no limit on size that I am aware of.

最大的不同在于它们的创建方式.

The big difference is how they get created.

XLSX - 读取内存中的整个文档

XLSX - reads the whole document in memory

XLSXSTREAM - 在处理过程中进行处理和垃圾收集,以提高内存效率.

XLSXSTREAM - processes and garbage collects as it processes so its memory efficient.

来自 POI 文档:

SXSSF(包:org.apache.poi.xssf.streaming)是一个API兼容的非常大的电子表格时使用的 XSSF 的流扩展必须生产,而且堆空间有限.SXSSF 达到其低通过限制对某个行内的行的访问来占用内存滑动窗口.

SXSSF (package: org.apache.poi.xssf.streaming) is an API-compatible streaming extension of XSSF to be used when very large spreadsheets have to be produced, and heap space is limited. SXSSF achieves its low memory footprint by limiting access to the rows that are within a sliding window.

基本上如果你不关心你的服务器资源,如果你有很多用户下载 Excel 文件,那么使用 XLSX 并且 JVM 内存对你使用 XLSXSTREAM 很重要

Basically if you don't care about your server resources use XLSX if you have many users downloading Excel files and JVM Memory is important to you use the XLSXSTREAM

这篇关于Primefaces DataExporter - XLSX 和 XLSXSTREAM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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