Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFRichTextString


        this.colNum = 0;
        this.currentRow = this.sheet.createRow(this.sheetRowNum++);
        this.currentCell = this.currentRow.createCell(this.colNum);
        this.currentCell.setCellStyle(style);
        String caption = model.getCaption();
        this.currentCell.setCellValue(new HSSFRichTextString(caption));
        this.rowSpanTable(model);
    }
View Full Code Here


            String v = value.toString();
            if (v.length() > utils.getWrapAtLength())
            {
                this.currentCell.getCellStyle().setWrapText(true);
            }
            this.currentCell.setCellValue(new HSSFRichTextString(ExcelUtils.escapeColumnValue(value)));
        }

    }
View Full Code Here

     * @param style Style used to render the header or footer.
     */
    private void writeHeaderFooter(String value, HSSFRow row, HSSFCellStyle style)
    {
        this.currentCell = row.createCell(this.colNum++);
        this.currentCell.setCellValue(new HSSFRichTextString(value));
        this.currentCell.setCellStyle(style);
    }
View Full Code Here

            this.currentRow = this.sheet.createRow(++rowNum);
            this.colNum = 0;
            prepareCell();
            prepareCell();
            prepareCell();
            this.currentCell.setCellValue(new HSSFRichTextString("------------"));

            this.currentRow = this.sheet.createRow(++rowNum);
            this.colNum = 0;
            prepareCell();
            prepareCell();
            this.currentCell.setCellValue(new HSSFRichTextString(value + " Total:"));
            prepareCell();
            this.currentCell.setCellValue(total);
        }
    }
View Full Code Here

          }
          else {
            return Double.toString (val);
          }
        case HSSFCell.CELL_TYPE_STRING :
          HSSFRichTextString s = cell.getRichStringCellValue();
          return s.getString ();
      }
    }
    return "";
  }
View Full Code Here

       
        for (int i = 0; i < headers.length; i++)
        {
          HSSFCell cell = row.createCell(i);
          cell.setCellStyle(style);
          HSSFRichTextString text = new HSSFRichTextString(headers[i]);
          cell.setCellValue(text);
        }
       
        for(int n = 1; n <= number; n++)
        {
          HSSFRow rowdata = sheet.createRow(n);
          int i = (n-1)+((t-1)*number);
          if(i < size)
          {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
            Scorecard card = cards.get(i);
            HSSFCell cell0 = rowdata.createCell(0);
            HSSFRichTextString text0 = new HSSFRichTextString(card.getCard());
            cell0.setCellValue(text0);
            cell0.setCellStyle(styledata);
           
            HSSFCell cell1 = rowdata.createCell(1);
//            HSSFRichTextString text1 = new HSSFRichTextString(card.getPassword());
            cell1.setCellValue(card.getPassword());
            cell1.setCellStyle(styledata);
           
            HSSFCell cell2 = rowdata.createCell(2);
//            HSSFRichTextString text2 = new HSSFRichTextString(card.getScore().toString());
            cell2.setCellValue(card.getScore());
            cell2.setCellStyle(styledata);
           
            HSSFCell cell3 = rowdata.createCell(3);
            HSSFRichTextString text3 = new HSSFRichTextString(sdf.format(card.getEffectiveTimeStart()));
            cell3.setCellValue(text3);
            cell3.setCellStyle(styledata);
           
            HSSFCell cell4 = rowdata.createCell(4);
            HSSFRichTextString text4 = new HSSFRichTextString(sdf.format(card.getEffectiveTimeEnd()));
            cell4.setCellValue(text4);
            cell4.setCellStyle(styledata);
          }
        }
      }
View Full Code Here

      HSSFRow row = sheet.createRow(0);

      for (int i = 0; i < headers.length; i++) {
        HSSFCell cell = row.createCell(i);
        cell.setCellStyle(style);
        HSSFRichTextString text = new HSSFRichTextString(headers[i]);
        cell.setCellValue(text);
      }

      for (int n = 1; n <= size; n++) {
        HSSFRow rowdata = sheet.createRow(n);
        // int i = (n - 1) + ((t - 1) * number);
        RebateContent rc = list.get(n-1);
        HSSFCell cell0 = rowdata.createCell(0);
        HSSFRichTextString text0 = new HSSFRichTextString(rc.getFllx());
        cell0.setCellValue(text0);
        cell0.setCellStyle(styledata);

        HSSFCell cell1 = rowdata.createCell(1);
        // HSSFRichTextString text1 = new
View Full Code Here

       
        for (int i = 0; i < headers.length; i++)
        {
          HSSFCell cell = row.createCell(i);
          cell.setCellStyle(style);
          HSSFRichTextString text = new HSSFRichTextString(headers[i]);
          cell.setCellValue(text);
        }
       
        for(int n = 1; n <= number; n++)
        {
          HSSFRow rowdata = sheet.createRow(n);
          int i = (n-1)+((t-1)*number);
          if(i < size)
          {
            Card card = cards.get(i);
            HSSFCell cell0 = rowdata.createCell(0);
            HSSFRichTextString text0 = new HSSFRichTextString(card.getId());
            cell0.setCellValue(text0);
            cell0.setCellStyle(styledata);
           
            HSSFCell cell1 = rowdata.createCell(1);
//            HSSFRichTextString text1 = new HSSFRichTextString(card.getPassword());
View Full Code Here

    }
  }

  private void createHeaderCell(final HSSFCell cell, final String value) {
    HSSFRichTextString hssfString = new HSSFRichTextString(value);
    hssfString.applyFont(HSSFFont.BOLDWEIGHT_BOLD);
    cell.setCellValue(hssfString);
  }
View Full Code Here

        for (Attribute attr : lf.getAttribute()) {
          int attributeIndex = attributeIds.indexOf(attr.getId());
          if (attributeIndex >= 0) {
            row.createCell((short) attributeIndex).setCellValue(
                new HSSFRichTextString(attr.getContent()));
          }
        }
        int attrSize = attributeIds.size();

        row.createCell((short) (attrSize)).setCellValue(
            new HSSFRichTextString(lf.getId()));

        row.createCell((short) (attrSize + 1)).setCellValue(
            new HSSFRichTextString(key));

        for (int j = 0; j < locales.length; j++) {
          HSSFCell cell = row.createCell((short) (j + attrSize + 2));
          cell.setCellValue(new HSSFRichTextString(values
              .get(locales[j])));
          cell.setCellStyle(localeCellStyle);
        }

      }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFRichTextString

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.