Reputation: 41
I need to remove entirely a ROW using JAKARTA POI. I use this method:
HSSFSheet sheet= wb.getSheetAt(0);
HSSFRow row = hoja.getRow(15);
sheet.removeRow(row);
but the problem is that it only removes the content of the cells. Not de entire row.
Any ideas?
Upvotes: 0
Views: 231
Reputation: 41
Thank you @CycDemo. I use this:
HSSFSheet hoja = wb.getSheetAt(0);
HSSFRow fila = hoja.getRow(numFila);
hoja.removeRow(fila);
hoja.shiftRows(numFila+1, hoja.getLastRowNum(), -1);
And it work fine!!!
Upvotes: 0
Reputation: 9935
Use HSSFSheet.shiftRows
function. Example
HSSFSheet.shiftRows(int startRow, int endRow, int n);
Upvotes: 2