解决方案 »
- 两个页面间的传值问题?
- jsp javabean的使用 vector存储自定义对象问题
- 哪位高手能帮我解下以下代码
- 关于一个商务网站的Servlet.service() for servlet jsp threw exception问题,请高手指点啊~~!!
- 关于Tomcat和SQL sever连接的问题
- 在 web.xml 中配置了 <error-page> ,但如何在 /Error.jsp 中把出错的信息显示出来????
- 来讨论吧!!!关于servlet的生成期问题,烦啊!!!!请看以下程序!!!!!!!!!!!!!!!!!!!!!!!
- response.sendRedirect问题
- 读取clob的问题
- 有人可以帮我远程解决这个问题吗qq:11044818
- 求助:JDK1.6+Tomcat6出现挂死的问题
- (求救~!!)ssh框架中。如何实现往数据库中一次性添加多条数据
//导出到Excel中
public void write(String[][]data,String path,String sheetName){
ArrayList<userModel> list = new ArrayList<userModel>();
list = this.getList();
init();
try {
WritableWorkbook book = Workbook.createWorkbook((new File(path )));
WritableSheet sheet = book.createSheet(sheetName, 0);
for (int i = 0; i < 18; i++) {
sheet.setColumnView(i, 20); // 设置列宽
}
sheet.setRowView(0, 600, false); // 设置行高 for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[i].length; j++) {
int num = 0;
try {
num = Integer.parseInt(data[i][j]);
sheet.addCell(new Number(j, i, num, centerStyle));
} catch (NumberFormatException e) {
sheet.addCell(new Label(j, i, data[i][j], centerStyle));
}
}
}
book.write();
book.close();
} catch (RowsExceededException e) {
e.printStackTrace();
} catch (WriteException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}