POI读取Excel文件有两种方式,一种是使用usermodel方式读取,这种方式的优势是统一接口开发,读取.xls文件的HSSFWorkbook与读取.xlsx文件的XSSFWorkbook两个类都实现了Workbook接口。另外一种是eventusermodel方式读取,这种方式比前面一种方式读取复杂很多,并且对与2003版本和2007版本的Excel处理没有统一接口,需要了解Excel的内部文件组织原理,但是效率却比第一种方式快得多,并却能轻松读取大量数据的Excel文件,而不会把内存溢出。我使用usermodel 方式可以取倒合并单元格中的值:取值代码如下:/** 
     * 获取合并单元格的值 
     * @param sheet 
     * @param row 
     * @param column 
     * @return 
     */  
    public String getMergedRegionValue(Sheet sheet ,int row , int column){  
        int sheetMergeCount = sheet.getNumMergedRegions();  
          
        for(int i = 0 ; i < sheetMergeCount ; i++){  
            CellRangeAddress ca = sheet.getMergedRegion(i);  
            int firstColumn = ca.getFirstColumn();  
            int lastColumn = ca.getLastColumn();  
            int firstRow = ca.getFirstRow();  
            int lastRow = ca.getLastRow();  
            if(row >= firstRow && row <= lastRow){  
                if(column >= firstColumn && column <= lastColumn){  
                    Row fRow = sheet.getRow(firstRow);  
                    Cell fCell = fRow.getCell(firstColumn);  
                      
                    return getCellValue(fCell) ;  
                }  
            }  
        }  
          
        return null ;  
    } 
问题 : 我使用eventusermodel方式读取xls,我不知道应该如何取合并单元格中的值,在线等,请赐教,谢谢了。