コード例 #1
0
 /**
  * Récupère les informations de fusion des cellules dans la sheet source pour les appliquer à la
  * sheet destination... Récupère toutes les zones merged dans la sheet source et regarde pour
  * chacune d'elle si elle se trouve dans la current row que nous traitons. Si oui, retourne
  * l'objet CellRangeAddress.
  *
  * @param sheet the sheet containing the data.
  * @param rowNum the num of the row to copy.
  * @param cellNum the num of the cell to copy.
  * @return the CellRangeAddress created.
  */
 public static CellRangeAddress getMergedRegion(XSSFSheet sheet, int rowNum, short cellNum) {
   for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
     CellRangeAddress merged = sheet.getMergedRegion(i);
     if (((CellRangeAddressBase) merged).isInRange(rowNum, cellNum)) {
       return merged;
     }
   }
   return null;
 }
コード例 #2
0
ファイル: SXSSFSheet.java プロジェクト: peke2/test_scala
 /**
  * Returns the number of merged regions
  *
  * @return number of merged regions
  */
 public int getNumMergedRegions() {
   return _sh.getNumMergedRegions();
 }