Examples of insertColumns()


Examples of org.zkoss.zss.engine.RefSheet.insertColumns()

  }
     
  private static ChangeInfo insertHSSFColumns(Worksheet sheet, int startCol, int num, int copyOrigin) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.insertColumns(startCol, num);
    final List<CellRangeAddress[]> shiftedRanges = ((HSSFSheetImpl)sheet).shiftColumnsOnly(startCol, -1, num, true, false, true, false, copyOrigin);
    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
View Full Code Here

Examples of org.zkoss.zss.engine.RefSheet.insertColumns()

  }
 
  private static ChangeInfo insertXSSFColumns(Worksheet sheet, int startCol, int num, int copyOrigin) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.insertColumns(startCol, num);
    final List<CellRangeAddress[]> shiftedRanges = ((XSSFSheetImpl)sheet).shiftColumnsOnly(startCol, -1, num, true, false, true, false, copyOrigin);
    final List<MergeChange> changeMerges = prepareChangeMerges(refSheet, shiftedRanges);
    final Set<Ref> last = refs[0];
    final Set<Ref> all = refs[1];
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
View Full Code Here

Examples of org.zkoss.zss.model.Sheet.insertColumns()

    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 1).getFormat().getFillColor()); //B2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 1).getFormat().getFillColor()); //B6
 
    //insert two columns
    sheet1.insertColumns(2, 3);
   
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 2).getFormat().getFillColor()); //C2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 2).getFormat().getFillColor()); //C6
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 3).getFormat().getFillColor()); //D2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 3).getFormat().getFillColor()); //D6
View Full Code Here

Examples of org.zkoss.zss.model.Sheet.insertColumns()

    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
   
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    try {
      sheet1.insertColumns(-1, -1);
      assertFalse("Should come here after sheet1.insertColumns(-1, -1);",true);
    } catch(Exception ex) {
      System.out.println(ex.getMessage());//correct and ignore
    }
  }
View Full Code Here

Examples of org.zkoss.zss.model.Sheet.insertColumns()

    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    int widthA = sheet1.getColumnWidth(0);
    int widthB = sheet1.getColumnWidth(1);
    int widthC = sheet1.getColumnWidth(2);
   
    sheet1.insertColumns(1,3);
   
    assertEquals(widthA, sheet1.getColumnWidth(0));
    assertTrue(widthB != sheet1.getColumnWidth(1));
    assertTrue(widthC != sheet1.getColumnWidth(2));
    assertEquals(widthB, sheet1.getColumnWidth(4));
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.