public class ExcelUtil
extends java.lang.Object
| Constructor | Description |
|---|---|
ExcelUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static org.apache.poi.xssf.usermodel.XSSFCellStyle |
addColorBackground(org.apache.poi.xssf.usermodel.XSSFCellStyle style,
byte r,
byte g,
byte b) |
Adds the color background.
|
static org.apache.poi.xssf.usermodel.XSSFCellStyle |
getBoldStyle(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook) |
Gets the bold style.
|
static java.util.Calendar |
getDateValue(org.apache.poi.ss.usermodel.Cell cell) |
Gets the date value.
|
static org.apache.poi.xssf.usermodel.XSSFRow |
getFirstRow(org.apache.poi.xssf.usermodel.XSSFSheet sheet) |
Gets the first row.
|
static org.apache.poi.xssf.usermodel.XSSFRow |
getFirstRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb,
java.lang.String sheetName) |
Gets the first row.
|
static org.apache.poi.xssf.usermodel.XSSFSheet |
getFirstSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) |
Gets the first sheet.
|
static org.apache.poi.ss.usermodel.Cell |
getHeaderCell(org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.xssf.usermodel.XSSFRow headerRow) |
Gets the header cell.
|
static java.lang.String |
getHeaderValue(org.apache.poi.ss.usermodel.Cell cell) |
Gets the header value.
|
static java.lang.String |
getHeaderValue(org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.xssf.usermodel.XSSFRow headerRow) |
Gets the header value.
|
static double |
getNumericValue(org.apache.poi.ss.usermodel.Cell cell) |
Gets the numeric value.
|
static org.apache.poi.xssf.usermodel.XSSFRichTextString |
getRichString(java.lang.String content,
org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
boolean bold,
int textHeight) |
Gets the rich string.
|
static java.lang.String |
getStringValue(org.apache.poi.ss.usermodel.Cell cell) |
Gets the string value.
|
static boolean |
isDateValue(org.apache.poi.ss.usermodel.Cell cell) |
Checks if is date value.
|
static boolean |
isNumericValue(org.apache.poi.ss.usermodel.Cell cell) |
Checks if is numeric value.
|
static boolean |
isStringValue(org.apache.poi.ss.usermodel.Cell cell) |
Checks if is string value.
|
static org.apache.poi.xssf.usermodel.XSSFWorkbook |
readExcel(java.lang.String fileName) |
Read excel.
|
static void |
setBorder(org.apache.poi.ss.usermodel.BorderStyle style,
org.apache.poi.ss.util.CellRangeAddress range,
org.apache.poi.xssf.usermodel.XSSFSheet sheet) |
|
static void |
setBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cellStyle,
org.apache.poi.ss.usermodel.BorderStyle bs,
int r,
int g,
int b) |
|
static void |
setBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cellStyle,
org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide side,
org.apache.poi.ss.usermodel.BorderStyle bs,
int r,
int g,
int b) |
|
static void |
setPrintArea(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
org.apache.poi.xssf.usermodel.XSSFSheet spreadsheet,
int maxRow,
int maxColumn,
boolean fitToPage) |
Sets the print area.
|
static void |
writeExcel(java.lang.String filename,
java.util.List<java.util.Map<Parameter,java.lang.Object>> dataMap,
java.util.List<Parameter> headerRow) |
Write excel.
|
public static void setBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cellStyle,
org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide side,
org.apache.poi.ss.usermodel.BorderStyle bs,
int r,
int g,
int b)
public static void setBorder(org.apache.poi.ss.usermodel.BorderStyle style,
org.apache.poi.ss.util.CellRangeAddress range,
org.apache.poi.xssf.usermodel.XSSFSheet sheet)
public static void setBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cellStyle,
org.apache.poi.ss.usermodel.BorderStyle bs,
int r,
int g,
int b)
public static org.apache.poi.xssf.usermodel.XSSFCellStyle addColorBackground(org.apache.poi.xssf.usermodel.XSSFCellStyle style,
byte r,
byte g,
byte b)
style - the styler - the rg - the gb - the bpublic static void writeExcel(java.lang.String filename,
java.util.List<java.util.Map<Parameter,java.lang.Object>> dataMap,
java.util.List<Parameter> headerRow)
filename - the filenamedataMap - the data mapheaderRow - the header rowpublic static void setPrintArea(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
org.apache.poi.xssf.usermodel.XSSFSheet spreadsheet,
int maxRow,
int maxColumn,
boolean fitToPage)
workbook - the workbookspreadsheet - the spreadsheetmaxRow - the max rowmaxColumn - the max columnfitToPage - the fit to pagepublic static org.apache.poi.xssf.usermodel.XSSFWorkbook readExcel(java.lang.String fileName)
fileName - the file namepublic static org.apache.poi.xssf.usermodel.XSSFSheet getFirstSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook wb)
wb - the wbpublic static org.apache.poi.xssf.usermodel.XSSFRow getFirstRow(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
sheet - the sheetpublic static org.apache.poi.xssf.usermodel.XSSFRow getFirstRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb,
java.lang.String sheetName)
wb - the wbsheetName - the sheet namepublic static boolean isStringValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static java.lang.String getHeaderValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static java.lang.String getHeaderValue(org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.xssf.usermodel.XSSFRow headerRow)
cell - the cellheaderRow - the header rowpublic static org.apache.poi.ss.usermodel.Cell getHeaderCell(org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.xssf.usermodel.XSSFRow headerRow)
cell - the cellheaderRow - the header rowpublic static java.lang.String getStringValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static double getNumericValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static boolean isNumericValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static boolean isDateValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static java.util.Calendar getDateValue(org.apache.poi.ss.usermodel.Cell cell)
cell - the cellpublic static org.apache.poi.xssf.usermodel.XSSFRichTextString getRichString(java.lang.String content,
org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
boolean bold,
int textHeight)
content - the contentworkbook - the workbookbold - the boldtextHeight - the text heightpublic static org.apache.poi.xssf.usermodel.XSSFCellStyle getBoldStyle(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook)
workbook - the workbook