public final class HSSFCellUtil extends Object
Modifier and Type | Method and Description |
---|---|
static HSSFCell |
createCell(HSSFRow row,
int column,
String value)
Create a cell, and give it a value.
|
static HSSFCell |
createCell(HSSFRow row,
int column,
String value,
HSSFCellStyle style)
Creates a cell, gives it a value, and applies a style if provided
|
static HSSFCell |
getCell(HSSFRow row,
int columnIndex)
Get a specific cell from a row.
|
static HSSFRow |
getRow(int rowIndex,
HSSFSheet sheet)
Get a row from the spreadsheet, and create it if it doesn't exist.
|
static void |
setAlignment(HSSFCell cell,
HSSFWorkbook workbook,
short align)
Take a cell, and align it.
|
static void |
setCellStyleProperty(HSSFCell cell,
HSSFWorkbook workbook,
String propertyName,
Object propertyValue)
This method attempt to find an already existing HSSFCellStyle that matches
what you want the style to be.
|
static void |
setFont(HSSFCell cell,
HSSFWorkbook workbook,
HSSFFont font)
Take a cell, and apply a font to it
|
static HSSFCell |
translateUnicodeValues(HSSFCell cell)
Looks for text in the cell that should be unicode, like α and provides the
unicode version of it.
|
public static HSSFRow getRow(int rowIndex, HSSFSheet sheet)
rowIndex
- The 0 based row numbersheet
- The sheet that the row is part of.public static HSSFCell getCell(HSSFRow row, int columnIndex)
row
- The row that the cell is part ofcolumnIndex
- The column index that the cell is in.public static HSSFCell createCell(HSSFRow row, int column, String value, HSSFCellStyle style)
row
- the row to create the cell incolumn
- the column index to create the cell invalue
- The value of the cellstyle
- If the style is not null, then setpublic static HSSFCell createCell(HSSFRow row, int column, String value)
row
- the row to create the cell incolumn
- the column index to create the cell invalue
- The value of the cellpublic static void setAlignment(HSSFCell cell, HSSFWorkbook workbook, short align)
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.align
- the column alignment to use.for alignment options
public static void setFont(HSSFCell cell, HSSFWorkbook workbook, HSSFFont font)
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.font
- The HSSFFont that you want to set...public static void setCellStyleProperty(HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue)
workbook
- The workbook that is being worked with.propertyName
- The name of the property that is to be
changed.propertyValue
- The value of the property that is to be
changed.cell
- The cell that needs it's style changesCopyright © 2020. All rights reserved.