public class ExcelBuilder extends Object implements IExcelBuilder
(or a copy in /doc)| Modifier and Type | Class and Description | 
|---|---|
static class  | 
ExcelBuilder.Type  | 
| Modifier and Type | Field and Description | 
|---|---|
protected org.apache.poi.ss.usermodel.Font | 
boldFont  | 
static boolean | 
CRASH_ON_CELL_OVERFLOW
States if the builder should throw an IllegalArgumentException or simply warn with a log once a cell index exceed
 max number of columns or row. 
 | 
protected org.apache.poi.ss.usermodel.CreationHelper | 
create  | 
protected int | 
currentSheetId  | 
protected org.apache.poi.ss.usermodel.Drawing | 
drawing  | 
static int | 
LAST_COLUMN  | 
static int | 
LAST_ROW  | 
static int | 
MAX_COLUMN
The max number of columns supported by an excel sheet (256="IV" column header) 
 | 
static int | 
MAX_ROW
The max number of rows supported by an excel sheet 
 | 
protected Map<Integer,org.apache.poi.ss.usermodel.Sheet> | 
sheets  | 
protected ExcelBuilder.Type | 
type  | 
protected org.apache.poi.ss.usermodel.Workbook | 
workbook  | 
| Constructor and Description | 
|---|
ExcelBuilder()  | 
ExcelBuilder(ExcelBuilder.Type type)  | 
ExcelBuilder(ExcelBuilder.Type type,
            String firstSheet)  | 
| Modifier and Type | Method and Description | 
|---|---|
org.apache.poi.ss.usermodel.Comment | 
addComment(org.apache.poi.ss.usermodel.Cell cell,
          String text,
          int row,
          int col,
          int colWidth,
          int rowHeight) | 
org.apache.poi.ss.usermodel.Comment | 
buildComment(String text,
            int row,
            int col,
            int colWidth,
            int rowHeight)
Return a Comment. 
 | 
Collection<org.apache.poi.ss.usermodel.Sheet> | 
getAllSheets() | 
org.apache.poi.ss.usermodel.Font | 
getBoldFont()  | 
org.apache.poi.hssf.util.HSSFColor | 
getColor(byte r,
        byte g,
        byte b)  | 
org.apache.poi.hssf.util.HSSFColor | 
getColor(ByteColor color)  | 
org.apache.poi.ss.usermodel.Sheet | 
getCurrentSheet() | 
int | 
getCurrentSheetId() | 
org.apache.poi.hssf.usermodel.HSSFWorkbook | 
getHSSFWorkbook()  | 
protected org.apache.poi.ss.usermodel.Cell | 
getOrCreateCell(int i,
               int j)  | 
protected org.apache.poi.ss.usermodel.Row | 
getOrCreateRow(int i)  | 
org.apache.poi.ss.usermodel.Workbook | 
getWorkbook() | 
org.apache.poi.ss.usermodel.Workbook | 
load(File file) | 
org.apache.poi.ss.usermodel.Workbook | 
load(String file) | 
int | 
loadPicture(String image)  | 
void | 
mergeRange(int firstRow,
          int firstColumn,
          int lastRow,
          int lastColumn) | 
org.apache.poi.ss.usermodel.CellStyle | 
newCellStyle()
Return a new cell style instance for the choosen workbook  
ExcelBuilder.Type. | 
org.apache.poi.ss.usermodel.CellStyle | 
newColoredCellStyle(ByteColor color) | 
org.apache.poi.ss.usermodel.Font | 
newFont()  | 
org.apache.poi.ss.usermodel.Font | 
newFont(int size)  | 
int | 
newSheet(int index,
        String name) | 
void | 
save(File file) | 
void | 
save(String file) | 
org.apache.poi.ss.usermodel.Cell | 
setCell(int row,
       int column,
       String content)
Set a cell text content with no styling information. 
 | 
org.apache.poi.ss.usermodel.Cell | 
setCell(int row,
       int column,
       String content,
       org.apache.poi.ss.usermodel.CellStyle style)
Set a cell content at the given indices, and apply the style if it is not null. 
 | 
void | 
setColumnWidth(int column,
              int width)
Set the width (in units of 1/256th of a character width) 
 | 
void | 
setColumnWidthAuto(int column) | 
void | 
setCurrentSheetId(int s) | 
void | 
setFreezePane(int colSplit,
             int rowSplit) | 
void | 
setFreezePane(int colSplit,
             int rowSplit,
             int leftmostColumn,
             int topRow) | 
void | 
setPicture(int pictureIdx,
          int col1,
          int row1,
          boolean resize)  | 
void | 
setRowHeight(int row,
            int height) | 
void | 
setSplitPane(int xSplitPos,
            int ySplitPos,
            int leftmostColumn,
            int topRow,
            int activePane) | 
protected boolean | 
sheetInitialized(int index)  | 
protected boolean | 
validateCellIndex(int row,
                 int column,
                 String content)
Validate a cell index. 
 | 
public static final int MAX_COLUMN
public static int MAX_ROW
public static final int LAST_COLUMN
public static final int LAST_ROW
public static final boolean CRASH_ON_CELL_OVERFLOW
protected ExcelBuilder.Type type
protected org.apache.poi.ss.usermodel.Workbook workbook
protected org.apache.poi.ss.usermodel.CreationHelper create
protected org.apache.poi.ss.usermodel.Drawing drawing
protected org.apache.poi.ss.usermodel.Font boldFont
protected int currentSheetId
public ExcelBuilder()
public ExcelBuilder(ExcelBuilder.Type type)
public ExcelBuilder(ExcelBuilder.Type type, String firstSheet)
public org.apache.poi.ss.usermodel.Workbook getWorkbook()
getWorkbook in interface IExcelBuilderpublic org.apache.poi.hssf.usermodel.HSSFWorkbook getHSSFWorkbook()
public org.apache.poi.ss.usermodel.Cell setCell(int row, int column, String content, org.apache.poi.ss.usermodel.CellStyle style)
setCell in interface IExcelBuilderrow - row indexcolumn - column indexcontent - a string to display in the cellstyle - a style to apply to the cellprotected boolean validateCellIndex(int row, int column, String content)
IllegalArgumentException if CRASH_ON_CELL_OVERFLOW is set to true.
 public org.apache.poi.ss.usermodel.Cell setCell(int row, int column, String content)
setCell in interface IExcelBuildersetCell(int i, int j, String content, CellStyle style)}public org.apache.poi.ss.usermodel.Sheet getCurrentSheet()
getCurrentSheet in interface IExcelBuilderpublic int getCurrentSheetId()
getCurrentSheetId in interface IExcelBuilderpublic void setCurrentSheetId(int s)
setCurrentSheetId in interface IExcelBuilderpublic int newSheet(int index, String name)
newSheet in interface IExcelBuilderpublic Collection<org.apache.poi.ss.usermodel.Sheet> getAllSheets()
getAllSheets in interface IExcelBuilderprotected boolean sheetInitialized(int index)
public void setRowHeight(int row, int height)
setRowHeight in interface IExcelBuilderpublic void setColumnWidth(int column, int width)
setColumnWidth in interface IExcelBuilderpublic void setColumnWidthAuto(int column)
setColumnWidthAuto in interface IExcelBuilderpublic void setFreezePane(int colSplit, int rowSplit)
setFreezePane in interface IExcelBuilderpublic void setFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
setFreezePane in interface IExcelBuilderpublic void setSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
setSplitPane in interface IExcelBuilderpublic void mergeRange(int firstRow, int firstColumn, int lastRow, int lastColumn)
mergeRange in interface IExcelBuilderpublic org.apache.poi.ss.usermodel.CellStyle newCellStyle()
ExcelBuilder.Type.newCellStyle in interface IExcelBuilderprotected org.apache.poi.ss.usermodel.Cell getOrCreateCell(int i, int j)
protected org.apache.poi.ss.usermodel.Row getOrCreateRow(int i)
public org.apache.poi.ss.usermodel.Comment addComment(org.apache.poi.ss.usermodel.Cell cell, String text, int row, int col, int colWidth, int rowHeight)
addComment in interface IExcelBuilderpublic org.apache.poi.ss.usermodel.Comment buildComment(String text, int row, int col, int colWidth, int rowHeight)
row - col - colWidth - rowHeight - public org.apache.poi.ss.usermodel.CellStyle newColoredCellStyle(ByteColor color)
newColoredCellStyle in interface IExcelBuilderpublic org.apache.poi.hssf.util.HSSFColor getColor(ByteColor color)
getColor in interface IExcelBuilderpublic org.apache.poi.hssf.util.HSSFColor getColor(byte r, byte g, byte b)
public int loadPicture(String image) throws IOException
loadPicture in interface IExcelBuilderIOExceptionpublic void setPicture(int pictureIdx, int col1, int row1, boolean resize)
setPicture in interface IExcelBuilderpublic org.apache.poi.ss.usermodel.Font getBoldFont()
getBoldFont in interface IExcelBuilderpublic org.apache.poi.ss.usermodel.Font newFont(int size)
newFont in interface IExcelBuilderpublic org.apache.poi.ss.usermodel.Font newFont()
newFont in interface IExcelBuilderpublic void save(String file) throws IOException
save in interface IExcelBuilderIOExceptionpublic void save(File file) throws IOException
save in interface IExcelBuilderIOExceptionpublic org.apache.poi.ss.usermodel.Workbook load(String file) throws org.apache.poi.openxml4j.exceptions.InvalidFormatException, IOException
load in interface IExcelBuilderorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionIOExceptionpublic org.apache.poi.ss.usermodel.Workbook load(File file) throws org.apache.poi.openxml4j.exceptions.InvalidFormatException, IOException
load in interface IExcelBuilderorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionIOExceptionCopyright © 2019 Nuxeo. All rights reserved.