public class JxlUtility
extends java.lang.Object
| Constructor and Description |
|---|
JxlUtility() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int row,
java.lang.String as_string)
加入XLS 以Row 為基準
|
void |
add(int row,
java.lang.String as_string,
jxl.write.WritableCellFormat inCellFormat)
加入XLS 以ROW 為基準, 若一整個Row 都是同一個CellFormat 可自定
|
void |
add(java.lang.Object[] inObjectCell) |
void |
closeTempletefile()
close templet file 開啟的動作
|
void |
copytemplmenetCellRowToOutputCellRow(int fromCell,
int rowend,
int toCell) |
void |
copyToSheet(int i,
java.lang.String insheetName,
java.lang.String tempSheetName) |
boolean |
create()
開始建立 xls 檔案, 建立前先設定work xls , 如果有template xls 也要先設定
|
boolean |
create(javax.servlet.http.HttpServletResponse response,
java.lang.String outputfilename)
產生 output To Web
|
boolean |
create(java.io.InputStream inis,
javax.servlet.http.HttpServletResponse response,
java.lang.String outputfilename)
create xls 直接將InputStream 送入
|
void |
createSheet(java.lang.String sheetname,
int sheetnum) |
boolean |
getIsdrawLine() |
java.lang.String |
getOutput_filename() |
jxl.write.WritableSheet |
getSheet()
取sheet name
|
jxl.write.WritableSheet |
getSheet(java.lang.String sheetname) |
int |
getStartColnum() |
java.lang.String |
getTemplate_filename() |
jxl.Workbook |
getTemplateXls()
get Template XLS
|
jxl.write.WritableWorkbook |
getWorkBook()
取目前工作的workbook
|
static java.lang.String |
nullToSpace(java.lang.String str) |
void |
putall(java.util.Hashtable inalldata) |
void |
removeSheet(java.lang.String insheetName)
刪除 sheet Name remove sheet
|
void |
saveToxls()
執行完畢後,儲存至實際檔案中
|
void |
setCurrentSheet(int i) |
void |
setCurrentSheet(java.lang.String sheetName)
設定目前使用Sheet
|
void |
setCurrentTemplateSheet(java.lang.String sheetName) |
void |
setIsdrawLine(boolean value)
設定是否畫線 true , false
|
void |
setOutput_filename(java.lang.String value)
設定Work xls filename
|
void |
setOutputPath(java.lang.String value) |
void |
setStartColnum(int value)
設定開始的Line default 為 0 , 第二行則為 1
|
void |
setTemplate_fielname(java.lang.String value)
設定 Template xls filename, template 路徑在 maliconfig.properties 定義
|
void |
setTemplatePath(java.lang.String intemppath)
設定templete path 目錄
|
void |
settemplementCellRowToOutputCellRow(java.lang.String inSheetName,
int startCellColumn,
int rowend,
java.util.Hashtable incellrows)
set 單一CellRow
|
void |
transMutiRowsToSheet(BaseTable indatas)
轉換mutirow, 可先定義
|
void |
transRealDataToSheet(BaseTable indatas)
轉換 worktablesheet 資料 單一狀態, 欄位對欄位轉換
|
void |
transRealDataToSheet(clsSqlData vfld) |
public java.lang.String getTemplate_filename()
public void setTemplate_fielname(java.lang.String value)
value - Stringpublic void setTemplatePath(java.lang.String intemppath)
intemppath - public java.lang.String getOutput_filename()
public jxl.Workbook getTemplateXls()
public void setOutput_filename(java.lang.String value)
value - Stringpublic int getStartColnum()
public void setOutputPath(java.lang.String value)
public void setStartColnum(int value)
value - intpublic boolean getIsdrawLine()
public void setCurrentSheet(java.lang.String sheetName)
sheetName - public void setCurrentTemplateSheet(java.lang.String sheetName)
public void setCurrentSheet(int i)
public void setIsdrawLine(boolean value)
value - booleanpublic boolean create()
throws java.lang.Exception
java.lang.Exceptionpublic boolean create(javax.servlet.http.HttpServletResponse response,
java.lang.String outputfilename)
throws java.lang.Exception
response - outputfilename - java.lang.Exceptionpublic boolean create(java.io.InputStream inis,
javax.servlet.http.HttpServletResponse response,
java.lang.String outputfilename)
throws java.lang.Exception
inis - response - outputfilename - java.lang.Exceptionpublic jxl.write.WritableWorkbook getWorkBook()
public void createSheet(java.lang.String sheetname,
int sheetnum)
public jxl.write.WritableSheet getSheet(java.lang.String sheetname)
public jxl.write.WritableSheet getSheet()
public void add(java.lang.Object[] inObjectCell)
public void add(int row,
java.lang.String as_string)
throws java.lang.Exception
row - intas_string - Stringjava.lang.Exceptionpublic void add(int row,
java.lang.String as_string,
jxl.write.WritableCellFormat inCellFormat)
row - as_string - inCellFormat - public void copytemplmenetCellRowToOutputCellRow(int fromCell,
int rowend,
int toCell)
public void settemplementCellRowToOutputCellRow(java.lang.String inSheetName,
int startCellColumn,
int rowend,
java.util.Hashtable incellrows)
throws jxl.write.biff.RowsExceededException,
jxl.write.WriteException
startCellColumn - 取templement CellColumnrowend - copy templement 的row 位置至rowend 為止incellrows - 準備set到各rowjxl.write.WriteExceptionjxl.write.biff.RowsExceededExceptionpublic void transRealDataToSheet(BaseTable indatas)
indatas - public void transRealDataToSheet(clsSqlData vfld)
public void transMutiRowsToSheet(BaseTable indatas)
insheet - indatas - public void putall(java.util.Hashtable inalldata)
public void saveToxls()
throws java.lang.Exception
java.lang.Exceptionpublic void closeTempletefile()
public static java.lang.String nullToSpace(java.lang.String str)
public void copyToSheet(int i,
java.lang.String insheetName,
java.lang.String tempSheetName)
i - 要建置新的 sheet arrayinsheetName - new sheet nametempSheetName - template sheet namepublic void removeSheet(java.lang.String insheetName)
insheetName -