Examples of cloneSheet()


Examples of loxia.support.excel.definition.ExcelSheet.cloneSheet()

  private ExcelSheet getExcelSheet(String sheet){
    if(BLANK_SHEET_DEF.equalsIgnoreCase(sheet)) return BLANK_SHEET;
    ExcelSheet sheetDefinition = sheetDefinitions.get(sheet);
    if(sheetDefinition == null)
      throw new RuntimeException("No sheet defintion found with name: " + sheet);
    return sheetDefinition.cloneSheet();
  }
}
View Full Code Here

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

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

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

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

  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

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

  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

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

  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

Examples of org.apache.poi.ss.usermodel.Workbook.cloneSheet()

        Workbook workbook = info.workbook;
        int oldIndex = workbook.getSheetIndex(oldName);
        if (oldIndex < 0) {
            throw new IllegalArgumentException();
        }
        Sheet newSheet = workbook.cloneSheet(oldIndex);
        int newIndex = workbook.getSheetIndex(newSheet);
        workbook.setSheetName(newIndex, newName);
    }

    private void setExplicitListConstraint(
View Full Code Here

Examples of org.apache.poi.ss.usermodel.Workbook.cloneSheet()

    @Test
    public void bug46250(){
        Workbook wb = openSample("46250.xls");
        Sheet sh = wb.getSheet("Template");
        Sheet cSh = wb.cloneSheet(wb.getSheetIndex(sh));

        HSSFPatriarch patriarch = (HSSFPatriarch) cSh.createDrawingPatriarch();
        HSSFTextbox tb = (HSSFTextbox) patriarch.getChildren().get(2);

        tb.setString(new HSSFRichTextString("POI test"));
View Full Code Here

Examples of org.apache.poi.ss.usermodel.Workbook.cloneSheet()

       
        // initially it is good
        writeTemp53691(wb, "agood");
       
        // clone sheet corrupts it
        Sheet sheet = wb.cloneSheet(0);
        writeTemp53691(wb, "bbad");

        // removing the sheet makes it good again
        wb.removeSheetAt(wb.getSheetIndex(sheet));
        writeTemp53691(wb, "cgood");
View Full Code Here

Examples of org.apache.poi.ss.usermodel.Workbook.cloneSheet()

        // removing the sheet makes it good again
        wb.removeSheetAt(wb.getSheetIndex(sheet));
        writeTemp53691(wb, "cgood");
       
        // cloning again and removing the conditional formatting makes it good again
        sheet = wb.cloneSheet(0);
        removeConditionalFormatting(sheet);       
        writeTemp53691(wb, "dgood");
       
        // cloning the conditional formatting manually makes it bad again
        cf = sheet.getSheetConditionalFormatting();
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.