2008年10月18日 星期六

[Java]使用Jxl api處理Excel檔


import java.io.FileOutputStream;
import java.io.OutputStream;
import jxl.*;
import jxl.write.*;


public class Main {

public static void main(String[] args) {

try {
OutputStream os = new FileOutputStream("Test.xls");
jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);

WritableSheet sheet = wwb.createSheet("First Sheet", 0);
Label label = new Label(0, 0, "This is a label");
sheet.addCell(label);
wwb.write();
wwb.close();

} catch (Exception e) {
System.out.println(e);
}

}
}

[REF]http://www.ibm.com/developerworks/cn/java/l-javaExcel/
[REF]http://poplaryy.javaeye.com/blog/187482

沒有留言:

張貼留言