remove Helper class

This commit is contained in:
hmdrzsharifi 2021-02-17 19:58:09 +03:30
parent a7c64b99ef
commit 0f19017581
1 changed files with 0 additions and 21 deletions

View File

@ -1,21 +0,0 @@
package com.baeldung.poi.excel.insert;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
public class InsertRowHelper {
public Workbook insertRowBetweenRows(String fileLocation, int startRow, int rowNumber) throws IOException {
Workbook workbook = new XSSFWorkbook(fileLocation);
Sheet sheet = workbook.getSheetAt(0);
int lastRow = sheet.getLastRowNum();
if (lastRow < startRow) {
sheet.createRow(startRow);
}
sheet.shiftRows(startRow, lastRow, rowNumber, true, true);
sheet.createRow(startRow);
return workbook;
}
}