|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.excelutils.WorkbookUtils
WorkbookUtils is a helper of Microsoft Excel,it's based on POI project
Constructor Summary | |
WorkbookUtils()
|
Method Summary | |
static void |
copyRow(HSSFSheet sheet,
int from,
int to,
int count)
copy row |
static boolean |
getBooleanCellValue(HSSFSheet sheet,
int rowNum,
int colNum)
get value of the cell |
static HSSFCell |
getCell(HSSFRow row,
int column)
get Cell, if not exists, create |
static HSSFCell |
getCell(HSSFSheet sheet,
int rowNum,
int colNum)
get cell, if not exists, create |
static java.util.Date |
getDateCellValue(HSSFSheet sheet,
int rowNum,
int colNum)
get value of the cell |
static double |
getNumericCellValue(HSSFSheet sheet,
int rowNum,
int colNum)
get value of the cell |
static HSSFRow |
getRow(int rowCounter,
HSSFSheet sheet)
get Row, if not exists, create |
static java.lang.String |
getStringCellValue(HSSFSheet sheet,
int rowNum,
int colNum)
get value of the cell |
static HSSFWorkbook |
openWorkbook(java.io.InputStream in)
Open an excel from InputStream |
static HSSFWorkbook |
openWorkbook(ServletContext ctx,
java.lang.String config)
Open Excel File |
static HSSFWorkbook |
openWorkbook(java.lang.String fileName)
Open an excel file by real fileName |
static void |
SaveWorkbook(HSSFWorkbook wb,
java.io.OutputStream out)
Save the Excel to OutputStream |
static void |
setCellValue(HSSFSheet sheet,
int rowNum,
int colNum,
boolean value)
set value of the cell |
static void |
setCellValue(HSSFSheet sheet,
int rowNum,
int colNum,
java.util.Date value)
set value of the cell |
static void |
setCellValue(HSSFSheet sheet,
int rowNum,
int colNum,
double value)
set value of the cell |
static void |
setCellValue(HSSFSheet sheet,
int rowNum,
int colNum,
java.lang.String value)
Set value of the cell |
static void |
setCellValue(HSSFSheet sheet,
int rowNum,
int colNum,
java.lang.String value,
short encoding)
set value of the cell |
static void |
shiftCell(HSSFSheet sheet,
HSSFRow row,
HSSFCell beginCell,
int shift,
int rowCount)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WorkbookUtils()
Method Detail |
public static HSSFWorkbook openWorkbook(ServletContext ctx, java.lang.String config) throws ExcelException
ctx
- ServletContextconfig
- Excel Template Name
ExcelException
public static HSSFWorkbook openWorkbook(java.lang.String fileName) throws ExcelException
fileName
-
ExcelException
public static HSSFWorkbook openWorkbook(java.io.InputStream in) throws ExcelException
in
-
ExcelException
public static void SaveWorkbook(HSSFWorkbook wb, java.io.OutputStream out) throws ExcelException
wb
- HSSFWorkbookout
- OutputStream
ExcelException
public static void setCellValue(HSSFSheet sheet, int rowNum, int colNum, java.lang.String value)
sheet
- HSSFSheetrowNum
- intcolNum
- intvalue
- Stringpublic static java.lang.String getStringCellValue(HSSFSheet sheet, int rowNum, int colNum)
sheet
- HSSFSheetrowNum
- intcolNum
- int
public static void setCellValue(HSSFSheet sheet, int rowNum, int colNum, java.lang.String value, short encoding)
sheet
- HSSFSheetrowNum
- intcolNum
- intvalue
- Stringencoding
- shortpublic static void setCellValue(HSSFSheet sheet, int rowNum, int colNum, double value)
sheet
- HSSFSheetrowNum
- intcolNum
- intvalue
- doublepublic static double getNumericCellValue(HSSFSheet sheet, int rowNum, int colNum)
sheet
- HSSFSheetrowNum
- intcolNum
- int
public static void setCellValue(HSSFSheet sheet, int rowNum, int colNum, java.util.Date value)
sheet
- HSSFSheetrowNum
- intcolNum
- intvalue
- Datepublic static java.util.Date getDateCellValue(HSSFSheet sheet, int rowNum, int colNum)
sheet
- HSSFSheetrowNum
- intcolNum
- int
public static void setCellValue(HSSFSheet sheet, int rowNum, int colNum, boolean value)
sheet
- HSSFSheetrowNum
- intcolNum
- intvalue
- booleanpublic static boolean getBooleanCellValue(HSSFSheet sheet, int rowNum, int colNum)
sheet
- rowNum
- colNum
-
public static HSSFRow getRow(int rowCounter, HSSFSheet sheet)
rowCounter
- intsheet
- HSSFSheet
public static HSSFCell getCell(HSSFRow row, int column)
row
- HSSFRowcolumn
- int
public static HSSFCell getCell(HSSFSheet sheet, int rowNum, int colNum)
sheet
- HSSFSheetrowNum
- intcolNum
- int
public static void copyRow(HSSFSheet sheet, int from, int to, int count)
sheet
- from
- begin of the rowto
- destination fo the rowcount
- count of copypublic static void shiftCell(HSSFSheet sheet, HSSFRow row, HSSFCell beginCell, int shift, int rowCount)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |