本文整理匯總了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getSheetIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java HSSFWorkbook.getSheetIndex方法的具體用法?Java HSSFWorkbook.getSheetIndex怎麽用?Java HSSFWorkbook.getSheetIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.poi.hssf.usermodel.HSSFWorkbook
的用法示例。
在下文中一共展示了HSSFWorkbook.getSheetIndex方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createNewSheet
import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
public static HSSFSheet createNewSheet(final HSSFWorkbook workbook, final int sheetNo, final String name, final Map<String, Integer> sheetNameMap) {
final HSSFSheet sheet = workbook.cloneSheet(sheetNo);
final int newSheetNo = workbook.getSheetIndex(sheet);
workbook.setSheetName(newSheetNo, decideSheetName(name, sheetNameMap));
return sheet;
}
示例2: createNewSheet
import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
public static HSSFSheet createNewSheet(HSSFWorkbook workbook, int sheetNo,
String name, Map<String, Integer> sheetNameMap) {
HSSFSheet sheet = workbook.cloneSheet(sheetNo);
int newSheetNo = workbook.getSheetIndex(sheet);
workbook.setSheetName(newSheetNo, decideSheetName(name, sheetNameMap));
return sheet;
}
示例3: moveSheet
import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
public static HSSFSheet moveSheet(final HSSFWorkbook workbook, final int sheetNo) {
final HSSFSheet oldSheet = workbook.getSheetAt(sheetNo);
final String sheetName = oldSheet.getSheetName();
final HSSFSheet newSheet = workbook.cloneSheet(sheetNo);
final int newSheetNo = workbook.getSheetIndex(newSheet);
workbook.removeSheetAt(sheetNo);
workbook.setSheetName(newSheetNo - 1, sheetName);
return newSheet;
}
示例4: moveSheet
import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
public static HSSFSheet moveSheet(HSSFWorkbook workbook, int sheetNo) {
HSSFSheet oldSheet = workbook.getSheetAt(sheetNo);
String sheetName = oldSheet.getSheetName();
HSSFSheet newSheet = workbook.cloneSheet(sheetNo);
int newSheetNo = workbook.getSheetIndex(newSheet);
workbook.removeSheetAt(sheetNo);
workbook.setSheetName(newSheetNo - 1, sheetName);
return newSheet;
}