/** * Writes cell. * * @param x cell x coordinate * @param y cell y coordinate * @param width cell width * @param height cell height * @param value cell value */ protected void writeCell(int x, int y, int width, int height, Object value) { writeCell(x, y, width, height, value, null); }
/** * Writes cell. * * @param x cell x coordinate * @param y cell y coordinate * @param value cell value */ protected void writeCell(int x, int y, Object value) { writeCell(x, y, 1, 1, value, null); }
/** * Writes table header. * * @param header header text for the table * @param style header style * * @throws IllegalStateException if method is called without prior * <code>beginTable()</code> call */ public void writeHeader(String header, ICellStyle style) { if (region == null) { throw new IllegalStateException("beginTable() has to be called"); } writeCell(0, currentRow++, width, 1, header, style); }
/** * Finishes writing a table. Saves the changes to excel sheet. * * @throws IllegalStateException if method is called without prior * <code>beginTable()</code> call * @throws CreateTableException if an exception occurred when saving */ public void endTable() throws CreateTableException { if (region == null) { throw new IllegalStateException("endTable() call without prior beginTable() call"); } for (int y = currentRow; y < height; ++y) { for (int x = 0; x < width; ++x) { writeCell(x, y, 1, 1, ""); } } region = null; style2style.clear(); }
writeCell(0, currentRow, 1, properties.size(), TABLE_PROPERTIES, style); Set<String> keys = properties.keySet(); for (String key : keys) { writeCell(1, currentRow, 1, 1, key, style); Object value = properties.get(key); writeCell(2, currentRow, 1, 1, value, style); writeCell(column, currentRow, 1, 1, null, style); column++;
writeCell(i, currentRow + j, cellWidth, cellHeight, cellValue, style); Cell newCell = PoiExcelHelper.getCell(i + region.getLeft(), currentRow + j + region.getTop(),