Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFRow.createCell()


    CellRangeAddress titleRange = new CellRangeAddress(0, 0, 0,
        setInfo.getFieldNames().get(sheetNum).length);
    sheets[sheetNum].addMergedRegion(titleRange);
    HSSFRow titleRow = sheets[sheetNum].createRow(0);
    titleRow.setHeight((short) 800);
    HSSFCell titleCell = titleRow.createCell(0);
    titleCell.setCellStyle(titleStyle);
    titleCell.setCellValue(setInfo.getTitles()[sheetNum]);
  }

  /**
 
View Full Code Here


    CellRangeAddress dateRange = new CellRangeAddress(1, 1, 0,
        setInfo.getFieldNames().get(sheetNum).length);
    sheets[sheetNum].addMergedRegion(dateRange);
    HSSFRow dateRow = sheets[sheetNum].createRow(1);
    dateRow.setHeight((short) 350);
    HSSFCell dateCell = dateRow.createCell(0);
    dateCell.setCellStyle(dateStyle);
    dateCell.setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
  }

  /**
 
View Full Code Here

  {
    // 表头
    HSSFRow headRow = sheets[sheetNum].createRow(2);
    headRow.setHeight((short) 350);
    // 序号列
    HSSFCell snCell = headRow.createCell(0);
    snCell.setCellStyle(headStyle);
    snCell.setCellValue("序号");
    // 列头名称
    for(int num = 1, len = setInfo.getHeadNames().get(sheetNum).length; num <= len; num++)
    {
View Full Code Here

    snCell.setCellStyle(headStyle);
    snCell.setCellValue("序号");
    // 列头名称
    for(int num = 1, len = setInfo.getHeadNames().get(sheetNum).length; num <= len; num++)
    {
      HSSFCell headCell = headRow.createCell(num);
      headCell.setCellStyle(headStyle);
      headCell.setCellValue(setInfo.getHeadNames().get(sheetNum)[num - 1]);
    }
  }
View Full Code Here

     
      HSSFSheet sheet = wb.createSheet("Test");
      HSSFRow row = sheet.createRow(0);
      HSSFCell cell;
     
      cell = row.createCell((short)0);
      cell.setCellFormula("NoQuotesNeeded!A1");
     
      cell = row.createCell((short)1);
      cell.setCellFormula("'Quotes Needed Here &#$@'!A1");
    }
View Full Code Here

      HSSFCell cell;
     
      cell = row.createCell((short)0);
      cell.setCellFormula("NoQuotesNeeded!A1");
     
      cell = row.createCell((short)1);
      cell.setCellFormula("'Quotes Needed Here &#$@'!A1");
    }
   
    public void testUnaryMinus()
    {
View Full Code Here

     
      HSSFSheet sheet = wb.createSheet("Test");
      HSSFRow row = sheet.createRow(0);
      HSSFCell cell;
     
      cell = row.createCell((short)0);
      cell.setCellFormula("Cash_Flow!A1");
   
  }

    // bug 38396 : Formula with exponential numbers not parsed correctly.
View Full Code Here

        wb.createSheet("Cash_Flow");;

        HSSFSheet sheet = wb.createSheet("Test");
        HSSFRow row = sheet.createRow(0);
        HSSFCell cell = row.createCell((short)0);
        String formula = null;

        cell.setCellFormula("1.3E21/3");
        formula = cell.getCellFormula();
        assertEquals("Exponential formula string", "1.3E21/3", formula);
View Full Code Here

     */
    private ByteArrayOutputStream setupRunFile(HSSFWorkbook book) throws Exception {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        HSSFSheet sheet = book.createSheet("Test");
        HSSFRow   row   = sheet.createRow(0);
        HSSFCell  cell  = row.createCell((short)0);
        cell.setCellValue(10.5);
        book.write(stream);
        return stream;
    }

View Full Code Here

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;

    cell = row.createCell((short)0);
    cell.setCellFormula("NoQuotesNeeded!A1");

    cell = row.createCell((short)1);
    cell.setCellFormula("'Quotes Needed Here &#$@'!A1");
  }
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.