[size=medium]
OutputStream os = response.getOutputStream();// 取得输出流
response.reset();// 清空输出流
response.setHeader("Content-disposition", "attachment; filename="+new String("Book1".getBytes("GB2312"),"8859_1")+".xls");// 设定输出文件头
response.setContentType("application/msexcel");// 定义输出类型
WritableWorkbook wwb = Workbook.createWorkbook(os); // 建立excel文件 [/size]
OutputStream os = response.getOutputStream();// 取得输出流
response.reset();// 清空输出流
response.setHeader("Content-disposition", "attachment; filename="+new String("Book1".getBytes("GB2312"),"8859_1")+".xls");// 设定输出文件头
response.setContentType("application/msexcel");// 定义输出类型
WritableWorkbook wwb = Workbook.createWorkbook(os); // 建立excel文件 [/size]