Package org.apache.poi.ss.util

Examples of org.apache.poi.ss.util.CellRangeAddress


        row = sheet.createRow(1);
        cell = row.createCell(1);
        cell.setCellValue(factory.createRichTextString("second row, second cell"));

        CellRangeAddress region = new CellRangeAddress(1, 1, 0, 1);
        sheet.addMergedRegion(region);

        sheet.shiftRows(1, 1, 1);

        region = sheet.getMergedRegion(0);
        assertEquals("Merged region not moved over to row 2", 2, region.getFirstRow());
    }
View Full Code Here


    public void test22720() {
       Workbook workBook = getTestDataProvider().createWorkbook();
       workBook.createSheet("TEST");
       Sheet template = workBook.getSheetAt(0);

       template.addMergedRegion(new CellRangeAddress(0, 1, 0, 2));
       template.addMergedRegion(new CellRangeAddress(1, 2, 0, 2));

       Sheet clone = workBook.cloneSheet(0);
       int originalMerged = template.getNumMergedRegions();
       assertEquals("2 merged regions", 2, originalMerged);
View Full Code Here

     * The purpose of this method is to validate the cell state prior to modification
     *
     * @see #notifyArrayFormulaChanging()
     */
    void notifyArrayFormulaChanging(String msg){
        CellRangeAddress cra = getArrayFormulaRange();
        if(cra.getNumberOfCells() > 1) {
            throw new IllegalStateException(msg);
        }
        //un-register the single-cell array formula from the parent XSSFSheet
        getRow().getSheet().removeArrayFormula(this);
    }
View Full Code Here

  public void process(Cell in, HTMLBuilder out) {
    if (in == null) {
      return;
    }
   
    CellRangeAddress cra = ConversionHelpers.getRangeForCell(in);
    if ((cra != null) && (ConversionHelpers.isPartOf(cra, in))) {
      int rowCount = getRangeRowCount(cra);
      int colCount = getRangeColCount(cra);
     
      if (rowCount  > 1 ) {
View Full Code Here

   
    if (s instanceof XSSFSheet) {
      XSSFSheet xssfSheet = (XSSFSheet) s;
     
      for (int i = 0; i < xssfSheet.getNumMergedRegions(); i++) {
        CellRangeAddress cra = xssfSheet.getMergedRegion(i);
        if (isPartOf(cra, in)) {
          return cra;
        }
      }
    }
View Full Code Here

  }

  enum CellType { TOP_LEFT_OF_RANGE, INDIVIDUAL, OTHER_CELL_IN_RANGE };

  protected CellType getCellType(Cell in) {
    CellRangeAddress cra  = ConversionHelpers.getRangeForCell(in);
       
    if (cra == null) {
      return CellType.INDIVIDUAL;
    } else if (isTopLeftOf(cra, in)) {
      return CellType.TOP_LEFT_OF_RANGE;
View Full Code Here

    mySheet.setDefaultColumnWidth(15);
    mySheet.setColumnWidth(0, 7000);
   
    myWorkBook.setSheetName(0, "Zehnjahresreport");

    cra = new CellRangeAddress(0, 0, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myRow = mySheet.createRow(0);
   
    myCell = myRow.createCell(0);
View Full Code Here

    double sozVersAN = 0;
    double gehaltNetto = 0;
    double sozVersAG = 0;
    double gesamtkosten = 0;
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    HSSFCellStyle emptyRightCellStyle = myWorkBook.createCellStyle();
    emptyRightCellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
   
    HSSFCellStyle emptyCellStyle = myWorkBook.createCellStyle();
   
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
     
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

    myCell.setCellValue("");
    myCell.setCellStyle(emptyRightCellStyle);
  }
 
  public void writeMonth(int k, int j){
    cra = new CellRangeAddress(mySheet.getLastRowNum()+1, mySheet.getLastRowNum()+1, 0, 7);
    mySheet.addMergedRegion( cra );
   
    myFont = myWorkBook.createFont();
    myFont.setFontHeight((short) 240);
    myFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.util.CellRangeAddress

Copyright © 2018 www.massapicom. 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.