Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet()


      total++;
    }

    if (sheetSize > 0) {
      for (int i = sheetIndex + 1, j = sheetSize; j < size; i++, j += sheetSize, total++) {
        workbook.cloneSheet(sheetIndex);
        workbook.setSheetOrder(workbook.getSheetName(total), i);
      }
    }

    // 取出Sheet开始填充
View Full Code Here


     *  cloning sheets with feat records
     */
    public void testCloneSheetWithFeatRecord() throws Exception {
        HSSFWorkbook wb =
            HSSFTestDataSamples.openSampleWorkbook("46136-WithWarnings.xls");
        wb.cloneSheet(0);
    }
}
View Full Code Here

  public void testCloneSheetBasic(){
    try{
      HSSFWorkbook b = new HSSFWorkbook();
      HSSFSheet s = b.createSheet("Test");
      s.addMergedRegion(new Region((short)0,(short)0,(short)1,(short)1));
      b.cloneSheet(0);
    }
    catch(Exception e){fail(e.getMessage());}
  }

}
View Full Code Here

  public void testCloneSheetBasic(){
    try{
      HSSFWorkbook b = new HSSFWorkbook();
      HSSFSheet s = b.createSheet("Test");
      s.addMergedRegion(new Region((short)0,(short)0,(short)1,(short)1));
      b.cloneSheet(0);
    }
    catch(Exception e){e.printStackTrace();fail(e.getMessage());}
  }

}
View Full Code Here

  public static void main(String[] args) throws Exception
  {
    Workbook wb = new HSSFWorkbook();
      wb.createSheet("new sheet");
      wb.createSheet("second sheet");
      Sheet cloneSheet = wb.cloneSheet(0);
     
      // now you have to manually copy all the data into new sheet from the cloneSheet
     
      //Print Message
        System.out.println("Cloned successfull.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.