POI 插入行
来源:互联网 发布:怎样获得淘宝优惠券 编辑:程序博客网 时间:2024/05/15 05:36
private static void insertRow(Sheet sheet, int starRow, int rows)
{
sheet.shiftRows(starRow + 1, sheet.getLastRowNum(), rows, true, false);
starRow = starRow - 1;
for (int i = 0; i < rows; i++) {
Row sourceRow = null;
Row targetRow = null;
Cell sourceCell = null;
Cell targetCell = null;
short m;
starRow = starRow + 1;
sourceRow = sheet.getRow(starRow);
targetRow = sheet.createRow(starRow + 1);
targetRow.setHeight(sourceRow.getHeight());
for (m = sourceRow.getFirstCellNum(); m < sourceRow.getLastCellNum(); m++)
{
System.out.println( "m:------>" + m);
sourceCell = sourceRow.getCell(m);
targetCell = targetRow.createCell(m);
targetCell.setCellStyle(sourceCell.getCellStyle());
targetCell.setCellType(sourceCell.getCellType());
}
}
}
{
sheet.shiftRows(starRow + 1, sheet.getLastRowNum(), rows, true, false);
starRow = starRow - 1;
for (int i = 0; i < rows; i++) {
Row sourceRow = null;
Row targetRow = null;
Cell sourceCell = null;
Cell targetCell = null;
short m;
starRow = starRow + 1;
sourceRow = sheet.getRow(starRow);
targetRow = sheet.createRow(starRow + 1);
targetRow.setHeight(sourceRow.getHeight());
for (m = sourceRow.getFirstCellNum(); m < sourceRow.getLastCellNum(); m++)
{
System.out.println( "m:------>" + m);
sourceCell = sourceRow.getCell(m);
targetCell = targetRow.createCell(m);
targetCell.setCellStyle(sourceCell.getCellStyle());
targetCell.setCellType(sourceCell.getCellType());
}
}
}
0 0
- POI实现插入行
- POI 插入行
- insertAdjacentHTML动态插入行
- TABLE下插入行
- insertAdjacentHTML动态插入行
- insertAdjacentHTML动态插入行
- insertAdjacentHTML动态插入行
- NPOI插入行
- 临时插入行、table、列
- 在GridView中插入行
- 在GridView中插入行
- 在GridView中插入行
- android sqlite 插入行计算
- OWC学习笔记-Spreadsheet插入行/列
- javascript 动态插入行 表格操作
- mysql 获取刚插入行id汇总
- 向数据表中插入行记录
- 正确获得最新插入行的标识
- MaterialDesign之Snackbar学习笔记
- 第十二周项目 1.3 实现复数类中的运算符重载
- log4j资料
- 11-散列1 电话聊天狂人
- matlab图片清晰度调整
- POI 插入行
- MFRC522模块开发笔记
- Android 内功心法(1.9)——java设计模式之装饰模式
- 优化大师每天定点自动优化脚本
- spring依赖注入
- leetcode increasing-triplet-subsequence
- JAVA前端与后端参数传递方法小结
- ViewPage + Fragment 实现订单管理的效果
- 第二章 单机存储系统