public static int copyToSheet(HSSFSheet parentSheet, int parentSheetRow, int parentSheetColumn, HSSFSheet sheet, boolean copyStyle) {
		int maxColumnNum = 0;
		Map<Integer, HSSFCellStyle> styleMap = (copyStyle) ? new HashMap<Integer, HSSFCellStyle>() : null;
		for (int i = sheet.getFirstRowNum(); i <= sheet.getLastRowNum(); i++) {
			HSSFRow srcRow = sheet.getRow(i);
			HSSFRow destRow;
			// subreport is not the first cell in a row
			if ((parentSheetColumn > 0) && (i == sheet.getFirstRowNum())) {
				destRow = parentSheet.getRow(parentSheetRow);
			} else {
				destRow = parentSheet.getRow(parentSheetRow+i);
				if (destRow == null) {
					destRow = parentSheet.createRow(parentSheetRow + i);
				}
			}
			if (srcRow != null) {
				XlsUtil.copyRow(sheet, parentSheet, parentSheetRow, parentSheetColumn, srcRow, destRow, styleMap);
				if (srcRow.getLastCellNum() > maxColumnNum) {
					maxColumnNum = srcRow.getLastCellNum();
				}
			}
		}
		for (int i = 0; i <= maxColumnNum; i++) {
			parentSheet.setColumnWidth(i, sheet.getColumnWidth(i));
		}
		return maxColumnNum;
	}
public static int copyToSheet ( HSSFSheet parentSheet , int parentSheetRow , int parentSheetColumn , HSSFSheet sheet , boolean copyStyle ) { int maxColumnNum = 0 ; Map < Integer , HSSFCellStyle > styleMap = ( copyStyle ) ? new HashMap < Integer , HSSFCellStyle > ( ) : null ; for ( int i = sheet . getFirstRowNum ( ) ; i <= sheet . getLastRowNum ( ) ; i ++ ) { HSSFRow srcRow = sheet . getRow ( i ) ; HSSFRow destRow ; if ( ( parentSheetColumn > 0 ) && ( i == sheet . getFirstRowNum ( ) ) ) { destRow = parentSheet . getRow ( parentSheetRow ) ; } else { destRow = parentSheet . getRow ( parentSheetRow + i ) ; if ( destRow == null ) { destRow = parentSheet . createRow ( parentSheetRow + i ) ; } } if ( srcRow != null ) { XlsUtil . copyRow ( sheet , parentSheet , parentSheetRow , parentSheetColumn , srcRow , destRow , styleMap ) ; if ( srcRow . getLastCellNum ( ) > maxColumnNum ) { maxColumnNum = srcRow . getLastCellNum ( ) ; } } } for ( int i = 0 ; i <= maxColumnNum ; i ++ ) { parentSheet . setColumnWidth ( i , sheet . getColumnWidth ( i ) ) ; } return maxColumnNum ; }
Copy a sheet to another sheet at a specific (row, column) position

@param parentSheet the sheet to copy into
@param parentSheetRow the row inside parentSheet where we start to copy
@param parentSheetColumn the column inside parentSheet where we start to copy
@param sheet the sheet that is copied
@param copyStyle true to copy the style
@return column number