导出excel
来源:互联网 发布:南阳理工软件 编辑:程序博客网 时间:2024/06/07 22:24
记录ExcelUtils.java测试函数
------------------------------------------------------------------------------------------------------------------
public static void main(String[] args) {
HSSFWorkbook workbook = new HSSFWorkbook();
ExcelUtils excelTool = new ExcelUtils(workbook);
excelTool.setSheetName("成绩表");
excelTool.setSheetDesc("测试数据");
String[]columns = new String[2];
columns[0] = "清运证编号";
columns[1] = "所属区域";
excelTool.setFieldNames(columns);
String [][] datas = new String [2][2];
datas[0][0] = "110";
datas[0][1] = "河西区";
datas[1][0] = "120";
datas[1][1] = "河东区";
File outFile = new File("C://text.xls");
try {
excelTool.setDatas(datas);
excelTool.buildExcelDocument();
FileOutputStream stream = new FileOutputStream(outFile);
workbook.write(stream);
stream.flush();
stream.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- 导出EXCEL
- Excel导出
- 导出Excel
- 导出EXCEL
- 导出Excel
- EXCEL导出
- 导出Excel
- 导出excel
- 导出excel
- EXCEL导出
- 导出excel
- 导出Excel
- Excel导出。
- 导出excel
- Excel 导出
- 导出excel
- 导出excel
- 导出excel
- MiniGUI输入法模块mGi软键盘使用实例
- linux的find、grep用法
- NHibernate使用3中框架动态代理方式Nhibernate常见的错误
- Magento Mgt Developer Toolbar安装详细说明
- 18种常见室内植物的功效
- 导出excel
- RedHat/CentOS系统信息查看命令大全
- Adapter的 cursor注入方式
- 目的
- Android 源码下载中遇到的问题
- linux cat 命令详解
- Android Window类
- windows命令行下常用命令
- 运行模拟器找不到路径 AVD 更改路径