Usages of

org.apache.poi.xssf.streaming.SXSSFCell.setCellValue(?)
static void createHeaderCell(SXSSFRow row, int index, String header, int width, CellStyle style) { SXSSFSheet sheet = row.getSheet(); sheet.setColumnWidth(index, width); SXSSFCell cell = row.createCell(index); cell.setCellValue(header); cell.setCellStyle(style); }
/** * ��������������� * * @param sheet * @param titles * @param object * @author nan.li */ private static void generateTitleRow(SXSSFSheet sheet, String[] titles, CellStyle cellStyle) { SXSSFRow row = sheet.createRow(0); for (int i = 0; i < titles.length; i++) { SXSSFCell cell = row.createCell(i); cell.setCellStyle(cellStyle);// ��������������������� cell.setCellValue(titles[i]); } }
/** * ��������������� * * @author nan.li * @param sheet * @param titles * @param object */ private static void generateTitleRow(SXSSFSheet sheet, String[] titles, CellStyle cellStyle) { SXSSFRow row = sheet.createRow(0); for (int i = 0; i < titles.length; i++) { SXSSFCell cell = row.createCell(i); cell.setCellStyle(cellStyle);// ��������������������� cell.setCellValue(titles[i]); } }
public static void createCell(SXSSFRow row, int cellNum, String cellValue, @Nullable CellStyle style, Map<Integer, Integer> cellWidth) { SXSSFCell cell = row.createCell(cellNum); cell.setCellValue(cellValue); if (style != null) { cell.setCellStyle(style); } if (cellWidth.get(cellNum) == null || cellWidth.get(cellNum) < cellValue.getBytes().length) { cellWidth.put(cellNum, cellValue.getBytes().length); } }
/** * * ������ :��������������� * ���������wuyechun 2016-6-24 * @param row * @param style * @param cellValue */ public static void createCell(SXSSFRow row,int column,CellStyle style,String cellValue){ SXSSFCell cell = row.createCell(column); cell.setCellStyle(style); cell.setCellValue(cellValue); }
/** * ���excel��������������������� * * @param record */ public void addRow(Object[] record) { if (sheetArray != null && isSheetSwitched && sheetRowi[sheeti] < 1048576) { SXSSFRow row = (SXSSFRow) sheetArray[sheeti] .createRow(this.sheetRowi[sheeti]); for (int i = 0; i < record.length; i++) { SXSSFCell cell = (SXSSFCell) row.createCell((short) i); String value = ObjectToString(record[i]); cell.setCellValue(new XSSFRichTextString(value)); } sheetRowi[sheeti]++; } }
/** * ������ Excel ��������������� * * @throws Throwable */ private void buildExcelTitleRow() throws Throwable { RowStyle rowStyle = writableSheet.getTitleRowStyle(); SXSSFRow row = sxssfSheet.createRow(rowStyle.getIndex()); row.setHeightInPoints(rowStyle.getHeight()); for (CellField cellField : cellFields) { int index = cellField.getIndex(); sxssfSheet.setColumnWidth(index, writableSheet.getCellWidth()); SXSSFCell cell = row.createCell(index); cell.setCellStyle(rowStyle.buildCellStyle(sxssfWorkbook)); cell.setCellValue(cellField.getName()); } }
private SXSSFCell cell = null; // code omitted ... /** * ������������ * @param sheetName * @param headers */ private void createSheet(String sheetName,String headers[][],SXSSFWorkbook wb) { sheet = (SXSSFSheet) wb.createSheet(sheetName); row = (SXSSFRow) sheet.createRow(currentRow); for (int i = 0; i < headers.length; i++) { //7680=30*256 sheet.setColumnWidth(i, 7680); cell = (SXSSFCell) row.createCell(i); cell.setCellType(XSSFCell.CELL_TYPE_STRING); cell.setCellValue(headers[i][0]); cell.setCellStyle(head_Style); } currentRow++; }
private static int createCellForUpdateInExcelCells(SXSSFSheet sheet, String values, int cellIndex, SXSSFRow row, boolean wrapText, boolean isNumeric) { int cellIndexx = cellIndex++; SXSSFCell cell = ExcelOperationUtil.createCell(row, cellIndexx); if (isNumeric && !StringUtils.isEmpty(values)) { Double value = Double.valueOf(values.replaceAll("[^0-9.]|\\s+", "")); cell.setCellValue(value); } else { cell.setCellValue(handleEmpty(values)); } if (wrapText) { cs.setWrapText(true); cell.setCellStyle(cs); } return cellIndex; }
private void excelHeadHandle(JSONObject jsonHead, SXSSFSheet sheet1) { SXSSFRow row = sheet1.createRow(0); JSONArray names = jsonHead.names(); int headerSize = names.size(); // ������������ for (int i = 0; i < headerSize; i++) { SXSSFCell cell = row.createCell(i); row.setHeightInPoints(20); String headName = names.optString(i); if (jsonHead.has(headName)) { headName = jsonHead.getString(names.optString(i)); } cell.setCellValue(headName); } }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes