easyexcel 导出设置标题_EasyPoi设置Excel导出样式(边框,背景色,字体)

这篇博客介绍了如何使用EasyExcel的工具类ExcelStyleUtil来定制Excel导出的样式,包括大标题、每列标题和数据行的样式。内容包括设置边框、背景色、字体大小和加粗等,并提供了样例代码展示如何在实际操作中应用这些样式。
摘要由CSDN通过智能技术生成

**导出样式如下图**

**使用方式**

创建一个样式工具类、工具类如下:

import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;

import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;

import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;

import org.apache.poi.ss.usermodel.*;

/**

* @author wxlbobo

* @date 2018/9/12

*/

public class ExcelStyleUtil implements IExcelExportStyler {

private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT");

private static final short FONT_SIZE_TEN = 10;

private static final short FONT_SIZE_ELEVEN = 11;

private static final short FONT_SIZE_TWELVE = 12;

/**

* 大标题样式

*/

private CellStyle headerStyle;

/**

* 每列标题样式

*

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值