导出Excel自主选择存放路径—输出流 OutputStream

来源:互联网 发布:二娃网络erwayun 编辑:程序博客网 时间:2024/06/10 19:08
      
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文件  
0 0