本文整理了Java中org.apache.poi.ss.usermodel.Row.removeCell
方法的一些代码示例,展示了Row.removeCell
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.removeCell
方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.Row
类名称:Row
方法名:removeCell
[英]Remove the Cell from this row.
[中]从此行中删除单元格。
代码示例来源:origin: org.apache.poi/poi-ooxml
row.removeCell(cell);
代码示例来源:origin: org.paxml/PaxmlCore
@Override
public void remove() {
Cell c = row.getCell(i);
if (c != null) {
row.removeCell(c);
}
}
代码示例来源:origin: org.paxml/paxml-core
@Override
public void remove() {
Cell c = row.getCell(i);
if (c != null) {
row.removeCell(c);
}
}
代码示例来源:origin: net.sf.jxls/jxls-core
static void clearRowCells(Row row, int startCell, int endCell) {
if (row != null && startCell >= 0 && endCell >= 0) {
for (int i = startCell; i <= endCell; i++) {
Cell cell = row.getCell(i);
if (cell != null) {
row.removeCell(cell);
}
row.createCell(i);
}
}
}
代码示例来源:origin: SheetJS/jxls
static void clearRowCells(Row row, int startCell, int endCell) {
if (row != null && startCell >= 0 && endCell >= 0) {
for (int i = startCell; i <= endCell; i++) {
Cell cell = row.getCell(i);
if (cell != null) {
row.removeCell(cell);
}
row.createCell(i);
}
}
}
代码示例来源:origin: net.sf.jxls/jxls-core
private static void clearAndRemoveCell(Row row, Cell cellToRemove) {
clearCell(cellToRemove);
if (cellToRemove != null) {
row.removeCell(cellToRemove);
}
}
代码示例来源:origin: SheetJS/jxls
private static void clearAndRemoveCell(Row row, Cell cellToRemove) {
clearCell(cellToRemove);
if (cellToRemove != null) {
row.removeCell(cellToRemove);
}
}
代码示例来源:origin: stackoverflow.com
String xlsxPath = "C:\\path\\test.xlsx";
Workbook wb = WorkbookFactory.create(new FileInputStream(xlsxPath));
// get first row
Row row = wb.getSheetAt(0).getRow(0);
// remove second cell from first row
row.removeCell(row.getCell(1));
// save changes
FileOutputStream fileOut = new FileOutputStream(xlsxPath);
wb.write(fileOut);
fileOut.close();
代码示例来源:origin: net.sf.jxls/jxls-core
public static void shiftCellsRight(Sheet sheet, int startRow,
int endRow, int startCol, int shiftNumber, boolean removeSourceMergedRegion) {
Set mergedRegions = new HashSet();
for (int rowNum = startRow; rowNum <= endRow; rowNum++) {
org.apache.poi.ss.usermodel.Row row = sheet.getRow(rowNum);
if (row != null) {
int lastCellNum = row.getLastCellNum();
for (int colNum = lastCellNum; colNum >= startCol; colNum--) {
int destColNum = colNum + shiftNumber;
org.apache.poi.ss.usermodel.Cell destCell = row.getCell(destColNum);
if (destCell == null) {
destCell = row.createCell(destColNum);
}
org.apache.poi.ss.usermodel.Cell cell = row.getCell(colNum);
if (cell == null) {
cell = row.createCell(colNum);
}
copyCell(cell, destCell, true);
Util.updateMergedRegionInRow(sheet, mergedRegions, rowNum, colNum, destColNum, removeSourceMergedRegion);
// Folowing 2 lines Added by kiransringeri@gmail.com
//Clear cell contents
row.removeCell(cell);
row.createCell(colNum);
}
}
}
}
代码示例来源:origin: spdx/tools
Cell cell = row.getCell(CREATED_BY_COL);
if (cell != null) {
row.removeCell(cell);
代码示例来源:origin: org.spdx/spdx-tools
Cell cell = row.getCell(CREATED_BY_COL);
if (cell != null) {
row.removeCell(cell);
代码示例来源:origin: org.spdx/spdx-tools
Cell cell = row.getCell(DOCUMENT_DESCRIBES_COL);
if (cell != null) {
row.removeCell(cell);
代码示例来源:origin: SheetJS/jxls
public static void shiftCellsRight(Sheet sheet, int startRow,
int endRow, int startCol, int shiftNumber, boolean removeSourceMergedRegion) {
Set mergedRegions = new HashSet();
for (int rowNum = startRow; rowNum <= endRow; rowNum++) {
org.apache.poi.ss.usermodel.Row row = sheet.getRow(rowNum);
if (row != null) {
int lastCellNum = row.getLastCellNum();
for (int colNum = lastCellNum; colNum >= startCol; colNum--) {
int destColNum = colNum + shiftNumber;
org.apache.poi.ss.usermodel.Cell destCell = row.getCell( destColNum);
if (destCell == null) {
destCell = row.createCell(destColNum);
}
org.apache.poi.ss.usermodel.Cell cell = row.getCell(colNum);
if (cell == null) {
cell = row.createCell(colNum);
}
copyCell(cell, destCell, true);
Util.updateMergedRegionInRow(sheet, mergedRegions, rowNum, colNum, destColNum, removeSourceMergedRegion);
// Folowing 2 lines Added by kiransringeri@gmail.com
//Clear cell contents
row.removeCell(cell);
row.createCell(colNum);
}
}
}
}
代码示例来源:origin: org.spdx/spdx-tools
Cell cell = row.getCell(CREATED_BY_COL);
if (cell != null) {
row.removeCell(cell);
代码示例来源:origin: spdx/tools
Cell cell = row.getCell(DOCUMENT_DESCRIBES_COL);
if (cell != null) {
row.removeCell(cell);
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Remove a row from this sheet. All cells contained in the row are removed as well
*
* @param row the row to remove.
*/
public void removeRow(Row row) {
if (row.getSheet() != this) {
throw new IllegalArgumentException("Specified row does not belong to this sheet");
}
// collect cells into a temporary array to avoid ConcurrentModificationException
ArrayList<XSSFCell> cellsToDelete = new ArrayList<XSSFCell>();
for(Cell cell : row) cellsToDelete.add((XSSFCell)cell);
for(XSSFCell cell : cellsToDelete) row.removeCell(cell);
int idx = _rows.headMap(row.getRowNum()).size();
_rows.remove(row.getRowNum());
worksheet.getSheetData().removeRow(idx);
}
代码示例来源:origin: openl-tablets/openl-tablets
public void clearCell(int col, int row) {
Sheet sheet = getSheet();
Cell cell = PoiExcelHelper.getCell(col, row, sheet);
if (cell != null) {
cell.removeCellComment();
cell.removeHyperlink();
sheet.getRow(row).removeCell(cell);
}
}
代码示例来源:origin: net.sf.jxls/jxls-core
row.removeCell(cell);
row.createCell(colNum);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
row.removeCell(cell);
代码示例来源:origin: org.datanucleus/datanucleus-excel
public void storeStringField(int fieldNumber, String value)
{
if (!isStorable(fieldNumber))
{
return;
}
Cell cell = row.getCell(getColumnMapping(fieldNumber).getColumn(0).getPosition(), MissingCellPolicy.CREATE_NULL_AS_BLANK);
if (value == null)
{
row.removeCell(cell);
}
else
{
CreationHelper createHelper = row.getSheet().getWorkbook().getCreationHelper();
cell.setCellValue(createHelper.createRichTextString(value));
}
}
内容来源于网络,如有侵权,请联系作者删除!