data.wb.setSheetOrder( data.sheet.getSheetName(), replacingSheetAt );
/** * Creates a new sheet for the workbook at specified index. * @param name name of new sheet * @param index of sheet (-1 adds the sheet at the end of all sheet) * @return sheet created */ public Sheet createSheet(int index, String name) { Sheet rc = getWorkbook().createSheet(name); if (index >= 0) getWorkbook().setSheetOrder(name, index); return rc; }
sheet = workbook.createSheet(sheetName); if (sheetIndex != null) { workbook.setSheetOrder(sheetName, sheetIndex); workbook.setSheetOrder(sheet.getSheetName(), sheetIndex); } else { ExcelWriteException e = new ExcelWriteException("SheetName and sheetIndex can't be both null.");