Examples of createCell()


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

        // output attributes
        HSSFRow row = sheet.createRow( sheet.getLastRowNum() + 1 );
        if ( exportDn )
        {
            HSSFCell cell = row.createCell( ( short ) 0 );
            cell.setEncoding( HSSFCell.ENCODING_UTF_16 );
            cell.setCellValue( record.getDnLine().getValueAsString() );
        }
        for ( String attributeName : attributeMap.keySet() )
        {
View Full Code Here

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

            }

            if ( headerRowAttributeNameMap.containsKey( attributeName ) )
            {
                short cellNum = ( ( Short ) headerRowAttributeNameMap.get( attributeName ) ).shortValue();
                HSSFCell cell = row.createCell( cellNum );
                cell.setEncoding( HSSFCell.ENCODING_UTF_16 );
                cell.setCellValue( value );
            }
        }
View Full Code Here

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

   */
  public void testMissingArg() {
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet("Sheet1");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell(0);
    cell.setCellFormula("1+IF(1,,)");
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
    CellValue cv;
    try {
      cv = fe.evaluate(cell);
View Full Code Here

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

        if (row == null) {
            row = sheet.createRow(rownum);
        }
        HSSFCell cell = row.getCell(col);
        if (cell == null) {
            cell = row.createCell(col);
        }
        cell.setCellStyle(commonStyle);
        return cell;
    }
View Full Code Here

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

        HSSFSheet sheet = workbook.createSheet(sheetName);

        // カラム名を設定
        HSSFRow row = sheet.createRow(0);
        for (int i = 0; i < columnInfos.length; i++) {
            HSSFCell cell = row.createCell(i);
            cell.setCellValue(columnInfos[i].getColumnName());
            cell.setCellStyle(titleStyle);
        }

        // DBのデータを設定
View Full Code Here

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

            rs = ps.executeQuery();
            while (rs.next()) {
                row = sheet.createRow(row.getRowNum() + 1);
                for (int i = 0; i < columnInfos.length; i++) {
                    ColumnInfo info = columnInfos[i];
                    HSSFCell cell = row.createCell(i);
                    cell.setCellStyle(commonStyle);
                    switch (info.getDataType()) {
                    case CHAR:
                    case VARCHAR:
                        String str = rs.getString(info.getColumnName());
View Full Code Here

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

           
            // Create a row and put some cells in it. Rows are 0 based.
            HSSFRow row = sheet.createRow(currentRow);
           
            // Create a cell and put a value in it.
            HSSFCell cell = row.createCell((short)0);
            cell.setCellValue(s);

            currentRow++;
     }
View Full Code Here

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

            HSSFRow headerRow = sheet.createRow(0);

            for (int columnIndex = 0; columnIndex < model.getColumnCount(); columnIndex++){
                String columnName = model.getColumnName(columnIndex);

                HSSFCell cell = headerRow.createCell(columnIndex);
                cell.setCellValue(columnName);

                HSSFCellStyle cellStyle = workbook.createCellStyle();
                HSSFFont tableHeadingFont = workbook.createFont();
                tableHeadingFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
View Full Code Here

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

        CellStyleCache cellStyleCache = new CellStyleCache(workbook, model.getProject());

        for (short rowIndex = 0; rowIndex < model.getRowCount(); rowIndex++) {
            HSSFRow row = sheet.createRow(rowIndex + 1);
            for (int columnIndex = 0; columnIndex < model.getColumnCount(); columnIndex++){
                HSSFCell cell = row.createCell(columnIndex);
                Object value = model.getValue(rowIndex, columnIndex);
                if (value != null) {
                    if (value instanceof Number) {
                        Number number = (Number) value;
                        double doubleValue = number.doubleValue();
View Full Code Here

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

            if (columnSize != null) {
              sheet.setColumnWidth((short) k, columnSize
                  .shortValue());
            }
          }
          cell = row.createCell((short) k);
          // dersom celle har verdi
          if (table.getValueAt(j - currentRow, k) != null) {

            // dersom det er grupperingssum satt og den er ulik
            // forrige
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.