public class XLSUtil extends java.lang.Object
Workbooks
plugin (Alexandre Dufour)Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_DOT_EXTENSION |
static java.lang.String |
FILE_EXTENSION |
Constructor and Description |
---|
XLSUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addImage(jxl.write.WritableSheet sheet,
jxl.write.WritableImage image)
Adds an image to the specified Sheet.
|
static void |
clear(jxl.write.WritableWorkbook workbook)
Clear the specified workbook (remove all pages).
|
static void |
clearPage(jxl.write.WritableSheet sheet,
java.lang.String name)
Clear the specified page (remove all rows)
|
static jxl.write.WritableSheet |
createNewPage(jxl.write.WritableWorkbook workbook,
java.lang.String title)
Creates and returns a new page for the specified workbook.
|
static jxl.write.WritableWorkbook |
createWorkbook(java.io.File file)
Creates and returns a new Workbook file.
|
static jxl.write.WritableWorkbook |
createWorkbook(java.lang.String filename)
Creates and returns a new Workbook file.
|
static jxl.write.WritableSheet |
getPage(jxl.write.WritableWorkbook workbook,
java.lang.String title)
Searches for the specified page in workbook and returns it.
|
static jxl.write.WritableWorkbook |
loadWorkbook(java.io.File file)
Deprecated.
Use
loadWorkbookForRead(File) or loadWorkbookForWrite(File)
depending your needs. |
static jxl.Workbook |
loadWorkbookForRead(java.io.File file)
Loads and returns Workbook from an existing file (read operation only)
|
static jxl.write.WritableWorkbook |
loadWorkbookForWrite(java.io.File file)
Loads and returns Workbook from an existing file (for write operation).
|
static void |
saveAndClose(jxl.write.WritableWorkbook workbook)
Saves and closes the specified Workbook.
|
static boolean |
setCellNumber(jxl.write.WritableSheet sheet,
int x,
int y,
double value)
Sets cell content in double format of specified Sheet.
|
static boolean |
setCellNumber(jxl.write.WritableSheet sheet,
int x,
int y,
double value,
jxl.format.Colour background)
Sets cell content in double format of specified Sheet.
|
static boolean |
setCellString(jxl.write.WritableSheet sheet,
int x,
int y,
java.lang.String value)
Sets cell content in string format of specified Sheet.
|
static boolean |
setCellString(jxl.write.WritableSheet sheet,
int x,
int y,
java.lang.String value,
jxl.format.Colour background)
Sets cell content in string format of specified Sheet.
|
static boolean |
setFromCSV(jxl.write.WritableSheet sheet,
java.lang.String csvContent)
Fill sheet content from CSV text.
|
static void |
setPageName(jxl.write.WritableSheet sheet,
java.lang.String name)
Sets name of specified Sheet
|
public static final java.lang.String FILE_EXTENSION
public static final java.lang.String FILE_DOT_EXTENSION
public XLSUtil()
public static jxl.write.WritableWorkbook createWorkbook(java.io.File file) throws java.io.IOException
java.io.IOException
public static jxl.write.WritableWorkbook createWorkbook(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static jxl.Workbook loadWorkbookForRead(java.io.File file) throws java.io.IOException, jxl.read.biff.BiffException
java.io.IOException
jxl.read.biff.BiffException
public static jxl.write.WritableWorkbook loadWorkbookForWrite(java.io.File file) throws java.io.IOException, jxl.read.biff.BiffException
saveAndClose(WritableWorkbook)
even if you don't
change the Workbook else you lost all previous data already present.java.io.IOException
jxl.read.biff.BiffException
@Deprecated public static jxl.write.WritableWorkbook loadWorkbook(java.io.File file) throws java.io.IOException, jxl.read.biff.BiffException
java.io.IOException
jxl.read.biff.BiffException
public static void saveAndClose(jxl.write.WritableWorkbook workbook) throws java.io.IOException, jxl.write.WriteException
java.io.IOException
jxl.write.WriteException
public static jxl.write.WritableSheet getPage(jxl.write.WritableWorkbook workbook, java.lang.String title)
public static jxl.write.WritableSheet createNewPage(jxl.write.WritableWorkbook workbook, java.lang.String title)
getPage(WritableWorkbook, String)
public static void clear(jxl.write.WritableWorkbook workbook)
public static void clearPage(jxl.write.WritableSheet sheet, java.lang.String name)
public static void setPageName(jxl.write.WritableSheet sheet, java.lang.String name)
public static boolean addImage(jxl.write.WritableSheet sheet, jxl.write.WritableImage image)
public static boolean setCellString(jxl.write.WritableSheet sheet, int x, int y, java.lang.String value, jxl.format.Colour background)
public static boolean setCellString(jxl.write.WritableSheet sheet, int x, int y, java.lang.String value)
public static boolean setCellNumber(jxl.write.WritableSheet sheet, int x, int y, double value, jxl.format.Colour background)
public static boolean setCellNumber(jxl.write.WritableSheet sheet, int x, int y, double value)
public static boolean setFromCSV(jxl.write.WritableSheet sheet, java.lang.String csvContent)
true
if the operation succeed