/** * Creates a new sheet within the workbook, at the specified position. * The new sheet is inserted at the specified position, or prepended/appended * to the list of sheets if the index specified is somehow inappropriate * * @param name the name of the new sheet * @param index the index at which to add the sheet * @return the created sheet */ public WritableSheet createSheet(String name, int index) { return createSheet(name, index, true); }
/** * Creates a new sheet within the workbook, at the specified position. * The new sheet is inserted at the specified position, or prepended/appended * to the list of sheets if the index specified is somehow inappropriate * * @param name the name of the new sheet * @param index the index at which to add the sheet * @return the created sheet */ public WritableSheet createSheet(String name, int index) { return createSheet(name, index, true); }
/** * Imports a sheet from a different workbook. Does a deep copy on all * elements within that sheet * * @param name the name of the new sheet * @param index the position for the new sheet within this workbook * @param sheet the sheet (from another workbook) to merge into this one * @return the new sheet */ public WritableSheet importSheet(String name, int index, Sheet sheet) { WritableSheet ws = createSheet(name, index); ((WritableSheetImpl) ws).importSheet(sheet); return ws; }
/** * Imports a sheet from a different workbook. Does a deep copy on all * elements within that sheet * * @param name the name of the new sheet * @param index the position for the new sheet within this workbook * @param sheet the sheet (from another workbook) to merge into this one * @return the new sheet */ public WritableSheet importSheet(String name, int index, Sheet sheet) { WritableSheet ws = createSheet(name, index); ((WritableSheetImpl) ws).importSheet(sheet); return ws; }
/** * Copies the specified sheet and places it at the index * specified by the parameter * * @param s the index of the sheet to copy * @param name the name of the new sheet * @param index the position of the new sheet */ public void copySheet(int s, String name, int index) { WritableSheet sheet = getSheet(s); WritableSheetImpl ws = (WritableSheetImpl) createSheet(name, index); ws.copy(sheet); }
/** * Copies the specified sheet and places it at the index * specified by the parameter * * @param s the index of the sheet to copy * @param name the name of the new sheet * @param index the position of the new sheet */ public void copySheet(int s, String name, int index) { WritableSheet sheet = getSheet(s); WritableSheetImpl ws = (WritableSheetImpl) createSheet(name, index); ws.copy(sheet); }
/** * Copies the specified sheet and places it at the index * specified by the parameter * * @param s the name of the sheet to copy * @param name the name of the new sheet * @param index the position of the new sheet */ public void copySheet(String s, String name, int index) { WritableSheet sheet = getSheet(s); WritableSheetImpl ws = (WritableSheetImpl) createSheet(name, index); ws.copy(sheet); }
/** * Copies the specified sheet and places it at the index * specified by the parameter * * @param s the name of the sheet to copy * @param name the name of the new sheet * @param index the position of the new sheet */ public void copySheet(String s, String name, int index) { WritableSheet sheet = getSheet(s); WritableSheetImpl ws = (WritableSheetImpl) createSheet(name, index); ws.copy(sheet); }
/** * Produces a writable copy of the workbook passed in by * creating copies of each sheet in the specified workbook and adding * them to its own record * * @param w the workbook to copy */ private void copyWorkbook(Workbook w) { int numSheets = w.getNumberOfSheets(); wbProtected = w.isProtected(); Sheet s = null; WritableSheetImpl ws = null; for (int i = 0 ; i < numSheets; i++) { s = w.getSheet(i); ws = (WritableSheetImpl) createSheet(s.getName(),i, false); ws.copy(s); } }
/** * Produces a writable copy of the workbook passed in by * creating copies of each sheet in the specified workbook and adding * them to its own record * * @param w the workbook to copy */ private void copyWorkbook(Workbook w) { int numSheets = w.getNumberOfSheets(); wbProtected = w.isProtected(); Sheet s = null; WritableSheetImpl ws = null; for (int i = 0 ; i < numSheets; i++) { s = w.getSheet(i); ws = (WritableSheetImpl) createSheet(s.getName(),i, false); ws.copy(s); } }