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

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

问题描述

似乎在最新版本的PrimeFaces中,为DataExporter添加了新类型(请参见

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?

推荐答案

我可以解释.它们都使用Apache POI产生完全相同的XLSX文件,它们是Excel文件的Open Document格式.我知道对大小没有限制.

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天全站免登陆