main
黄海 2 years ago
parent a8b7311e2e
commit c4d4029671

@ -185,13 +185,11 @@
<artifactId>poi</artifactId>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.5</version>
</dependency>
<!--引用jsoup防止xss攻击-->
<dependency>
<groupId>org.jsoup</groupId>

@ -6,6 +6,7 @@ import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.dialect.PostgreSqlDialect;
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.DefaultIndexedColorMap;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -48,9 +49,9 @@ public class TestExportExcel {
// 创建工作簿和工作表
Workbook workbook = new XSSFWorkbook();
SXSSFWorkbook workbook = new SXSSFWorkbook();//默认100行超100行将写入临时文件
workbook.setCompressTempFiles(false); //是否压缩临时文件,否则写入速度更快,但更占磁盘,但程序最后是会将临时文件删掉的
Sheet sheet = workbook.createSheet(memo);
// 创建单元格样式对象
CellStyle headerStyle = workbook.createCellStyle();
// 设置水平居中

Loading…
Cancel
Save