This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public XSSFSheet cloneSheet(int sheetIndex, String requestedName) { | |
| validateSheetIndex(sheetIndex); | |
| XSSFSheet sourceSheet = getSourceSheet(sheetIndex); | |
| String targetName = resolveSheetName(sourceSheet, requestedName); | |
| XSSFSheet clonedSheet = createSheet(targetName); | |
| copySheetRelations(sourceSheet, clonedSheet); | |
| copyExternalRelationships(sourceSheet, clonedSheet); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public XSSFSheet cloneSheet(int sheetNum, String newName) { | |
| validateSheetIndex(sheetNum); | |
| XSSFSheet srcSheet = sheets.get(sheetNum); | |
| // 1. Name Resolution | |
| String validatedName = resolveNewSheetName(srcSheet, newName); | |
| XSSFSheet clonedSheet = createSheet(validatedName); | |
| // 2. Relationship Cloning | |
| copySheetRelationships(srcSheet, clonedSheet); |