@Override public void setWritableCell(TableModel tableModel, XSSFCell cell, Object value, int row, int col) { XSSFWorkbook wb = cell.getSheet().getWorkbook(); cell.setCellStyle(cellStyle); cell.setCellValue(wb.getCreationHelper().createRichTextString(value.toString())); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } }
cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC); } else if (d instanceof Boolean) { cell.setCellValue(createHelper.createRichTextString((Boolean) d ? StaticWidgetHelper.getSynaptixWidgetConstantsBundle().printTrue() : StaticWidgetHelper.getSynaptixWidgetConstantsBundle() .printFalse())); cell.setCellStyle(styleMap.get(IHierarchicalExportWriter.Type.TEXT)); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } else if (d instanceof String) { cell.setCellValue(createHelper.createRichTextString((String) d)); cell.setCellStyle(styleMap.get(IHierarchicalExportWriter.Type.TEXT)); cell.setCellType(XSSFCell.CELL_TYPE_STRING); text = getString(d, objectsToStringByClassMap); cell.setCellValue(createHelper.createRichTextString(text)); cell.setCellStyle(styleMap.get(IHierarchicalExportWriter.Type.TEXT)); cell.setCellType(XSSFCell.CELL_TYPE_STRING);
@Override public void setWritableCell(TableModel tableModel, XSSFCell cell, Object value, int row, int col) { XSSFWorkbook wb = cell.getSheet().getWorkbook(); cell.setCellStyle(cellStyle); cell.setCellValue(wb.getCreationHelper().createRichTextString(getString(tableModel, value, row, col))); cell.setCellType(XSSFCell.CELL_TYPE_STRING); }
@Override public void setWritableCell(TableModel tableModel, XSSFCell cell, Object value, int row, int col) { String string = getString((LocalTime) value); XSSFWorkbook wb = cell.getSheet().getWorkbook(); cell.setCellStyle(cellStyle); cell.setCellType(XSSFCell.CELL_TYPE_STRING); if (string != null) { cell.setCellValue(wb.getCreationHelper().createRichTextString(string)); } }
cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC); } else if (d instanceof Boolean) { cell.setCellValue(createHelper.createRichTextString((Boolean) d ? SwingMessages.getString("TableFileWriter.13") //$NON-NLS-1$ : SwingMessages.getString("TableFileWriter.14"))); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } else if (d instanceof String) { cell.setCellValue(createHelper.createRichTextString((String) d)); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } else { cell.setCellValue(createHelper.createRichTextString(d.toString())); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); cell.setCellValue(createHelper.createRichTextString("")); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING);
cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC); } else if (d instanceof Boolean) { cell.setCellValue(createHelper.createRichTextString((Boolean) d ? SwingMessages.getString("TableFileWriter.13") //$NON-NLS-1$ : SwingMessages.getString("TableFileWriter.14"))); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } else if (d instanceof String) { cell.setCellValue(createHelper.createRichTextString((String) d)); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); } else { cell.setCellValue(createHelper.createRichTextString(d.toString())); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING); cell.setCellValue(createHelper.createRichTextString("")); cell.setCellStyle(textCs); cell.setCellType(XSSFCell.CELL_TYPE_STRING);
private void createExcelHeader(XSSFWorkbook workbook, XSSFSheet tableSheet) throws Exception { XSSFFont f = workbook.createFont(); f.setFontHeightInPoints((short) 12); f.setColor(IndexedColors.BLACK.getIndex()); XSSFDataFormat df = workbook.createDataFormat(); XSSFCellStyle cs = workbook.createCellStyle(); cs.setFont(f); cs.setDataFormat(df.getFormat("text")); cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); cs.setFillPattern(FillPatternType.SOLID_FOREGROUND); cs.setWrapText(true); XSSFCreationHelper createHelper = workbook.getCreationHelper(); XSSFRow rh = tableSheet.createRow(0); for (int i = 0; i < table.getColumnCount(); i++) { XSSFCell c1 = rh.createCell(i); c1.setCellStyle(cs); c1.setCellValue(createHelper.createRichTextString(table.getColumnName(i))); c1.setCellType(XSSFCell.CELL_TYPE_STRING); } }
protected void createExcelHeader(XSSFWorkbook workbook, XSSFSheet tableSheet) throws Exception { XSSFFont f = workbook.createFont(); f.setFontHeightInPoints((short) 12); f.setColor(IndexedColors.BLACK.getIndex()); XSSFDataFormat df = workbook.createDataFormat(); XSSFCellStyle cs = workbook.createCellStyle(); cs.setFont(f); cs.setDataFormat(df.getFormat("text")); cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); cs.setFillPattern(FillPatternType.SOLID_FOREGROUND); cs.setWrapText(true); XSSFCreationHelper createHelper = workbook.getCreationHelper(); XSSFRow rh = tableSheet.createRow(0); for (int i = 0; i < table.getColumnCount(); i++) { XSSFCell c1 = rh.createCell(i); c1.setCellStyle(cs); c1.setCellValue(createHelper.createRichTextString(table.getColumnName(i))); c1.setCellType(XSSFCell.CELL_TYPE_STRING); } }