POI Excel 冷冻线
冷冻线
Sheet.createFreezePane
data bar and color scale
SheetConditionalFormatting scf = sheet.getSheetConditionalFormatting();
ConditionalFormattingRule cfr = getConditionalFormattingRule( scf );
CellRangeAddress cra[] = {new CellRangeAddress(ROW_ROOT_INDEX, ROW_ROOT_INDEX + rows.length,
COLUMN_ROOT_INDEX, COLUMN_ROOT_INDEX + columns.length * className.length )};
scf.addConditionalFormatting(cra, cfr);
private ConditionalFormattingRule getConditionalFormattingRule( SheetConditionalFormatting scf ) {
ConditionalFormattingRule cfr = scf.createConditionalFormattingRule("");
try {
Method m = cfr.getClass().getDeclaredMethod("getCTCfRule");
m.setAccessible(true);
CTCfRule cfRule = (CTCfRule) m.invoke(cfr);
m.setAccessible(false);
cfRule.removeFormula(0);
// cfRule.setType(STCfType.DATA_BAR);
// CTDataBar databar = cfRule.addNewDataBar();
// CTCfvo vfoMin = databar.addNewCfvo();
// vfoMin.setType(STCfvoType.NUM);
// vfoMin.setVal("0");
// CTCfvo vfoMax = databar.addNewCfvo();
// vfoMax.setType(STCfvoType.NUM);
// vfoMax.setVal("1");
// CTColor color = databar.addNewColor();
// color.setRgb(new byte[] { (byte) 0xFF, 0x00, 0x00, (byte) 0xFF });
cfRule.setType(STCfType.COLOR_SCALE);
CTColorScale cScale = cfRule.addNewColorScale();
CTCfvo vfo = cScale.addNewCfvo();
vfo.setType(STCfvoType.NUM);
vfo.setVal("0");
vfo = cScale.addNewCfvo();
vfo.setType(STCfvoType.NUM);
vfo.setVal("0.5");
vfo = cScale.addNewCfvo();
vfo.setType(STCfvoType.NUM);
vfo.setVal("1");
CTColor color = cScale.addNewColor();
color.setRgb(new byte[]{(byte)255, (byte)99, (byte)190, (byte)123});
color = cScale.addNewColor();
color.setRgb(new byte[]{(byte)255, (byte)255, (byte)235, (byte)132});
color = cScale.addNewColor();
color.setRgb(new byte[]{(byte)255, (byte)248, (byte)105, (byte)107});
} catch (Exception e) {
e.printStackTrace();
cfr = null;
}
return cfr;
}
POI Excel 冷冻线的更多相关文章
- poi 升级至4.x 的问题总结(POI Excel 单元格内容类型判断并取值)
POI Excel 单元格内容类型判断并取值 以前用 cell.getCachedFormulaResultType() 得到 type 升级到4后获取不到了 换为:cell.getCellType( ...
- POI Excel 合并数据相同的行
import java.io.Serializable; /** * POI Excel报表导出,列合并实体<br> * * @author WQ * */ public class Po ...
- 关于GC(上):Apache的POI组件导致线上频繁FullGC问题排查及处理全过程
某线上应用在进行查询结果导出Excel时,大概率出现持续的FullGC.解决这个问题时,记录了一下整个的流程,也可以作为一般性的FullGC问题排查指导. 1. 生成dump文件 为了定位FullGC ...
- poi excel导出,下载
poi.jar包 public void downExcel(HttpServletResponse response,Page<ShopApply> page) throws Excep ...
- poi excel导入
poi.jar包 import java.io.File;import java.io.FileInputStream;import java.io.IOException; import org.a ...
- java, poi, excel
工作需要用java操作Excel,现在网上搜索了一下,决定选取POI包来操作.pom内容如下: <dependency> <groupId>org.apache.poi< ...
- POI/Excel/HTML单元格公式问题
一.问题描述 使用MyBatis从数据库中获取数据,然后用POI把数据填充到Excel模板中,生成最终的xls文件.把最终的xls文件转换为html文件,并返回给前台显示在Panel中. Excel模 ...
- POI excel导出
******************************* excel表格导出,使用POI实现 ******************************* 实现导出步骤 --配置导出excel ...
- poi excel超出65536行数限制自动扩展Invalid row number (65536) outside allow
1.xls一个sheet只能装65536行,多余则报错 poi包导出或写入excel超出65536报错: java.lang.IllegalArgumentException: Invalid row ...
随机推荐
- ubuntu16.04 登录密码破解方法
1:开机按Shift键,出现如下界面.(手速要快,Shift键要按时间久一点) 选择第二项 2:按回车键进入如下界面,然后选中有recovery mode的选项(第三项) 3:按e进入如下界面,并找到 ...
- ubuntu16.04新服务器上配置selenium+firefox
ubuntu16.041安装pythonsudo apt-get install python默认2.7.122更新apt-getsudo apt-get update更新下apt-get库否则下载p ...
- 搭建MongoDB分片集群
在部门服务器搭建MongoDB分片集群,记录整个操作过程,朋友们也可以参考. 计划如下: 用5台机器搭建,IP分别为:192.168.58.5.192.168.58.6.192.168.58.8.19 ...
- ingress高可用--使用DaemonSet方式部署ingress-nginx
前言 为了配置kubernetes中的ingress的高可用,对于kubernetes集群以外只暴露一个访问入口,需要使用keepalived排除单点问题.需要使用daemonset方式将ingres ...
- flask 框架 前端和后端请求超时问题
部署模式 flask + Gunicorn + nginx 为什么要用Gunicorn + nginx ? 请看知乎大神们的回答:https://www.zhihu.com/question/3852 ...
- iOS活体人脸识别的Demo和一些思路
代码地址如下:http://www.demodashi.com/demo/12011.html 之前公司项目需要,研究了一下人脸识别和活体识别,并运用免费的讯飞人脸识别,在其基础上做了二次开发,添加了 ...
- <转>多线程中的lua同步问题
转自 http://www.cnblogs.com/ghost240/p/3526185.html 最近写paintsnow::start时出现了一个非常麻烦的BUG,程序的Release版本大约每运 ...
- Sonatype Nexus
Maven 常用的仓库管理http://zh.wikipedia.org/wiki/Apache_Maven
- POJ 3278: Catch That Cow
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 44613 Accepted: 13946 ...
- rational rose 2007安装破解全过程
1:下载安装文件 下载地址: http://pan.baidu.com/s/1c0ldKEs 2:下载虚拟光驱 由于下载的文件须要光驱安装,所以须要下载一个虚拟光驱,虚拟光驱名称:daemon too ...